summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/trace-event.h
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2009-11-25 01:15:48 -0600
committerIngo Molnar <mingo@elte.hu>2009-11-28 10:04:26 +0100
commit16c632de64a74644a46e7636db26b2cfb530ca13 (patch)
tree4e7fdb4f84a1fba8b299c61a97bc76a8033e0565 /tools/perf/util/trace-event.h
parenteb9a42caa7a926beb935a22bc59d981b35f0b652 (diff)
downloadop-kernel-dev-16c632de64a74644a46e7636db26b2cfb530ca13.zip
op-kernel-dev-16c632de64a74644a46e7636db26b2cfb530ca13.tar.gz
perf trace: Add Perl scripting support
Implement trace_scripting_ops to make Perl a supported perf trace scripting language. Additionally adds code that allows Perl trace scripts to access the 'flag' and 'symbolic' (__print_flags(), __print_symbolic()) field information parsed from the trace format files. Also adds the Perl implementation of the generate_script() trace_scripting_op, which creates a ready-to-run perf trace Perl script based on existing trace data. Scripts generated by this implementation print out all the fields for each event mentioned in perf.data (and will detect and generate the proper scripting code for 'flag' and 'symbolic' fields), and will additionally generate handlers for the special 'trace_unhandled', 'trace_begin' and 'trace_end' handlers. Script authors can simply remove the printing code to implement their own custom event handling. Signed-off-by: Tom Zanussi <tzanussi@gmail.com> Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org Cc: anton@samba.org Cc: hch@infradead.org LKML-Reference: <1259133352-23685-4-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/trace-event.h')
-rw-r--r--tools/perf/util/trace-event.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index aeb9157..b1e58d3 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -245,10 +245,14 @@ extern int latency_format;
int parse_header_page(char *buf, unsigned long size);
int trace_parse_common_type(void *data);
+int trace_parse_common_pid(void *data);
struct event *trace_find_event(int id);
+struct event *trace_find_next_event(struct event *event);
+unsigned long long read_size(void *ptr, int size);
unsigned long long
raw_field_value(struct event *event, const char *name, void *data);
void *raw_field_ptr(struct event *event, const char *name, void *data);
+unsigned long long eval_flag(const char *flag);
int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events);
@@ -272,4 +276,7 @@ struct scripting_ops {
int script_spec_register(const char *spec, struct scripting_ops *ops);
+extern struct scripting_ops perl_scripting_ops;
+void setup_perl_scripting(void);
+
#endif /* __PERF_TRACE_EVENTS_H */
OpenPOWER on IntegriCloud