^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __TRACE_SYNTH_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __TRACE_SYNTH_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include "trace_dynevent.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define SYNTH_SYSTEM "synthetic"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define SYNTH_FIELDS_MAX 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define STR_VAR_LEN_MAX MAX_FILTER_STR_VAL /* must be multiple of sizeof(u64) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct synth_field {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) char *type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) size_t size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) unsigned int offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) unsigned int field_pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) bool is_signed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) bool is_string;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) bool is_dynamic;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct synth_event {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct dyn_event devent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) int ref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct synth_field **fields;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) unsigned int n_fields;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct synth_field **dynamic_fields;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned int n_dynamic_fields;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) unsigned int n_u64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct trace_event_class class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct trace_event_call call;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct tracepoint *tp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct module *mod;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) extern struct synth_event *find_synth_event(const char *name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #endif /* __TRACE_SYNTH_H */