]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
perf_counter: Add counter->id to the throttle event
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 11 Jun 2009 12:57:55 +0000 (14:57 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 11 Jun 2009 15:54:45 +0000 (17:54 +0200)
So as to be able to distuinguish between multiple counters.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/perf_counter.h
kernel/perf_counter.c

index 1fa1a26cb1b35ed63fc82af920409c52e37ae57a..6e133954e2e44a95e968c09a7a8b3669280ce74d 100644 (file)
@@ -286,6 +286,7 @@ enum perf_event_type {
         * struct {
         *      struct perf_event_header        header;
         *      u64                             time;
+        *      u64                             id;
         * };
         */
        PERF_EVENT_THROTTLE             = 5,
index 8859b97390ecf92dc2ebdfc8ce7945bfde2493a8..ef5d8a5b245390130f76e9284f372396dfa7ddd5 100644 (file)
@@ -2950,13 +2950,15 @@ static void perf_log_throttle(struct perf_counter *counter, int enable)
        struct {
                struct perf_event_header        header;
                u64                             time;
+               u64                             id;
        } throttle_event = {
                .header = {
                        .type = PERF_EVENT_THROTTLE + 1,
                        .misc = 0,
                        .size = sizeof(throttle_event),
                },
-               .time = sched_clock(),
+               .time   = sched_clock(),
+               .id     = counter->id,
        };
 
        ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0);