]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/perf_counter.h
tracing: Add perf counter support for syscalls tracing
[net-next-2.6.git] / include / linux / perf_counter.h
index bd15d7a5f5ce39474d4c845e1cb7d85bf9150bd9..8e6460fb4c023a3aa6e335880bb062fc803ba2a9 100644 (file)
@@ -121,8 +121,9 @@ enum perf_counter_sample_format {
        PERF_SAMPLE_CPU                         = 1U << 7,
        PERF_SAMPLE_PERIOD                      = 1U << 8,
        PERF_SAMPLE_STREAM_ID                   = 1U << 9,
+       PERF_SAMPLE_RAW                         = 1U << 10,
 
-       PERF_SAMPLE_MAX = 1U << 10,             /* non-ABI */
+       PERF_SAMPLE_MAX = 1U << 11,             /* non-ABI */
 };
 
 /*
@@ -181,8 +182,9 @@ struct perf_counter_attr {
                                freq           :  1, /* use freq, not period  */
                                inherit_stat   :  1, /* per task counts       */
                                enable_on_exec :  1, /* next exec enables     */
+                               task           :  1, /* trace fork/exit       */
 
-                               __reserved_1   : 51;
+                               __reserved_1   : 50;
 
        __u32                   wakeup_events;  /* wakeup every n events */
        __u32                   __reserved_2;
@@ -308,6 +310,15 @@ enum perf_event_type {
         */
        PERF_EVENT_COMM                 = 3,
 
+       /*
+        * struct {
+        *      struct perf_event_header        header;
+        *      u32                             pid, ppid;
+        *      u32                             tid, ptid;
+        * };
+        */
+       PERF_EVENT_EXIT                 = 4,
+
        /*
         * struct {
         *      struct perf_event_header        header;
@@ -323,6 +334,7 @@ enum perf_event_type {
         * struct {
         *      struct perf_event_header        header;
         *      u32                             pid, ppid;
+        *      u32                             tid, ptid;
         * };
         */
        PERF_EVENT_FORK                 = 7,
@@ -357,6 +369,8 @@ enum perf_event_type {
         *
         *      { u64                   nr,
         *        u64                   ips[nr];  } && PERF_SAMPLE_CALLCHAIN
+        *      { u32                   size;
+        *        char                  data[size];}&& PERF_SAMPLE_RAW
         * };
         */
        PERF_EVENT_SAMPLE               = 9,
@@ -402,6 +416,11 @@ struct perf_callchain_entry {
        __u64                           ip[PERF_MAX_STACK_DEPTH];
 };
 
+struct perf_raw_record {
+       u32                             size;
+       void                            *data;
+};
+
 struct task_struct;
 
 /**
@@ -670,6 +689,7 @@ struct perf_sample_data {
        struct pt_regs                  *regs;
        u64                             addr;
        u64                             period;
+       struct perf_raw_record          *raw;
 };
 
 extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
@@ -714,6 +734,8 @@ extern int sysctl_perf_counter_mlock;
 extern int sysctl_perf_counter_sample_rate;
 
 extern void perf_counter_init(void);
+extern void perf_tpcounter_event(int event_id, u64 addr, u64 count,
+                                void *record, int entry_size);
 
 #ifndef perf_misc_flags
 #define perf_misc_flags(regs)  (user_mode(regs) ? PERF_EVENT_MISC_USER : \