aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/traceevent
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-05-22 01:52:40 -0400
committerNamhyung Kim <namhyung@kernel.org>2012-07-04 00:40:30 -0400
commit0866a97eb7562409ba792f5e904841dd8e23c8b5 (patch)
tree16ea556526c18b58bed884096644afaa974c27ae /tools/lib/traceevent
parentc2e6dc2b268cca44d522b2ee86147f0d30d7e3e4 (diff)
tools lib traceevent: Add support to show migrate disable counter
The RT kernel added a migrate disable counter in all events. Add support to show this in the latency format. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/n/tip-l6ulxyda952g7kua4pfsh73k@git.kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/lib/traceevent')
-rw-r--r--tools/lib/traceevent/event-parse.c57
1 files changed, 38 insertions, 19 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 0644c2a23ad6..872dd35db051 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -2884,7 +2884,7 @@ static int get_common_info(struct pevent *pevent,
2884 event = pevent->events[0]; 2884 event = pevent->events[0];
2885 field = pevent_find_common_field(event, type); 2885 field = pevent_find_common_field(event, type);
2886 if (!field) 2886 if (!field)
2887 die("field '%s' not found", type); 2887 return -1;
2888 2888
2889 *offset = field->offset; 2889 *offset = field->offset;
2890 *size = field->size; 2890 *size = field->size;
@@ -2935,15 +2935,16 @@ static int parse_common_flags(struct pevent *pevent, void *data)
2935 2935
2936static int parse_common_lock_depth(struct pevent *pevent, void *data) 2936static int parse_common_lock_depth(struct pevent *pevent, void *data)
2937{ 2937{
2938 int ret; 2938 return __parse_common(pevent, data,
2939 2939 &pevent->ld_size, &pevent->ld_offset,
2940 ret = __parse_common(pevent, data, 2940 "common_lock_depth");
2941 &pevent->ld_size, &pevent->ld_offset, 2941}
2942 "common_lock_depth");
2943 if (ret < 0)
2944 return -1;
2945 2942
2946 return ret; 2943static int parse_common_migrate_disable(struct pevent *pevent, void *data)
2944{
2945 return __parse_common(pevent, data,
2946 &pevent->ld_size, &pevent->ld_offset,
2947 "common_migrate_disable");
2947} 2948}
2948 2949
2949static int events_id_cmp(const void *a, const void *b); 2950static int events_id_cmp(const void *a, const void *b);
@@ -3988,10 +3989,13 @@ void pevent_data_lat_fmt(struct pevent *pevent,
3988 struct trace_seq *s, struct pevent_record *record) 3989 struct trace_seq *s, struct pevent_record *record)
3989{ 3990{
3990 static int check_lock_depth = 1; 3991 static int check_lock_depth = 1;
3992 static int check_migrate_disable = 1;
3991 static int lock_depth_exists; 3993 static int lock_depth_exists;
3994 static int migrate_disable_exists;
3992 unsigned int lat_flags; 3995 unsigned int lat_flags;
3993 unsigned int pc; 3996 unsigned int pc;
3994 int lock_depth; 3997 int lock_depth;
3998 int migrate_disable;
3995 int hardirq; 3999 int hardirq;
3996 int softirq; 4000 int softirq;
3997 void *data = record->data; 4001 void *data = record->data;
@@ -3999,18 +4003,26 @@ void pevent_data_lat_fmt(struct pevent *pevent,
3999 lat_flags = parse_common_flags(pevent, data); 4003 lat_flags = parse_common_flags(pevent, data);
4000 pc = parse_common_pc(pevent, data); 4004 pc = parse_common_pc(pevent, data);
4001 /* lock_depth may not always exist */ 4005 /* lock_depth may not always exist */
4002 if (check_lock_depth) {
4003 struct format_field *field;
4004 struct event_format *event;
4005
4006 check_lock_depth = 0;
4007 event = pevent->events[0];
4008 field = pevent_find_common_field(event, "common_lock_depth");
4009 if (field)
4010 lock_depth_exists = 1;
4011 }
4012 if (lock_depth_exists) 4006 if (lock_depth_exists)
4013 lock_depth = parse_common_lock_depth(pevent, data); 4007 lock_depth = parse_common_lock_depth(pevent, data);
4008 else if (check_lock_depth) {
4009 lock_depth = parse_common_lock_depth(pevent, data);
4010 if (lock_depth < 0)
4011 check_lock_depth = 0;
4012 else
4013 lock_depth_exists = 1;
4014 }
4015
4016 /* migrate_disable may not always exist */
4017 if (migrate_disable_exists)
4018 migrate_disable = parse_common_migrate_disable(pevent, data);
4019 else if (check_migrate_disable) {
4020 migrate_disable = parse_common_migrate_disable(pevent, data);
4021 if (migrate_disable < 0)
4022 check_migrate_disable = 0;
4023 else
4024 migrate_disable_exists = 1;
4025 }
4014 4026
4015 hardirq = lat_flags & TRACE_FLAG_HARDIRQ; 4027 hardirq = lat_flags & TRACE_FLAG_HARDIRQ;
4016 softirq = lat_flags & TRACE_FLAG_SOFTIRQ; 4028 softirq = lat_flags & TRACE_FLAG_SOFTIRQ;
@@ -4029,6 +4041,13 @@ void pevent_data_lat_fmt(struct pevent *pevent,
4029 else 4041 else
4030 trace_seq_putc(s, '.'); 4042 trace_seq_putc(s, '.');
4031 4043
4044 if (migrate_disable_exists) {
4045 if (migrate_disable < 0)
4046 trace_seq_putc(s, '.');
4047 else
4048 trace_seq_printf(s, "%d", migrate_disable);
4049 }
4050
4032 if (lock_depth_exists) { 4051 if (lock_depth_exists) {
4033 if (lock_depth < 0) 4052 if (lock_depth < 0)
4034 trace_seq_putc(s, '.'); 4053 trace_seq_putc(s, '.');