trace-event.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _PERF_UTIL_TRACE_EVENT_H
  2. #define _PERF_UTIL_TRACE_EVENT_H
  3. #include "parse-events.h"
  4. #include "trace-parse-events.h"
  5. #include "session.h"
  6. struct machine;
  7. struct perf_sample;
  8. union perf_event;
  9. struct thread;
  10. int read_tracing_data(int fd, struct list_head *pattrs);
  11. struct tracing_data {
  12. /* size is only valid if temp is 'true' */
  13. ssize_t size;
  14. bool temp;
  15. char temp_file[50];
  16. };
  17. struct tracing_data *tracing_data_get(struct list_head *pattrs,
  18. int fd, bool temp);
  19. void tracing_data_put(struct tracing_data *tdata);
  20. struct scripting_ops {
  21. const char *name;
  22. int (*start_script) (const char *script, int argc, const char **argv);
  23. int (*stop_script) (void);
  24. void (*process_event) (union perf_event *event,
  25. struct perf_sample *sample,
  26. struct perf_evsel *evsel,
  27. struct machine *machine,
  28. struct thread *thread);
  29. int (*generate_script) (const char *outfile);
  30. };
  31. int script_spec_register(const char *spec, struct scripting_ops *ops);
  32. void setup_perl_scripting(void);
  33. void setup_python_scripting(void);
  34. struct scripting_context {
  35. void *event_data;
  36. };
  37. int common_pc(struct scripting_context *context);
  38. int common_flags(struct scripting_context *context);
  39. int common_lock_depth(struct scripting_context *context);
  40. #endif /* _PERF_UTIL_TRACE_EVENT_H */