aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2012-08-16 15:10:20 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-08-17 12:13:08 -0400
commitdb146f06ac0bbea63271b6c78f4341ee46843e10 (patch)
treed0a9f99316401b82049118b585238a044f68a976
parent6606f8733d7b635e09e2dc3a391a5e1f0feb218f (diff)
perf tools: Rename global variable 'events' in util/header.c
Trivial patch that renames global variable 'events' in util/header.c. Use a more specific naming to avoid conflicts. Same for variable 'event_count'. Signed-off-by: Robert Richter <robert.richter@amd.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1345144224-27280-5-git-send-email-robert.richter@amd.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/header.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index e2e5129873f1..1e5b6aa60523 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -23,8 +23,8 @@
23 23
24static bool no_buildid_cache = false; 24static bool no_buildid_cache = false;
25 25
26static int event_count; 26static int trace_event_count;
27static struct perf_trace_event_type *events; 27static struct perf_trace_event_type *trace_events;
28 28
29static u32 header_argc; 29static u32 header_argc;
30static const char **header_argv; 30static const char **header_argv;
@@ -36,24 +36,24 @@ int perf_header__push_event(u64 id, const char *name)
36 if (strlen(name) > MAX_EVENT_NAME) 36 if (strlen(name) > MAX_EVENT_NAME)
37 pr_warning("Event %s will be truncated\n", name); 37 pr_warning("Event %s will be truncated\n", name);
38 38
39 nevents = realloc(events, (event_count + 1) * sizeof(*events)); 39 nevents = realloc(trace_events, (trace_event_count + 1) * sizeof(*trace_events));
40 if (nevents == NULL) 40 if (nevents == NULL)
41 return -ENOMEM; 41 return -ENOMEM;
42 events = nevents; 42 trace_events = nevents;
43 43
44 memset(&events[event_count], 0, sizeof(struct perf_trace_event_type)); 44 memset(&trace_events[trace_event_count], 0, sizeof(struct perf_trace_event_type));
45 events[event_count].event_id = id; 45 trace_events[trace_event_count].event_id = id;
46 strncpy(events[event_count].name, name, MAX_EVENT_NAME - 1); 46 strncpy(trace_events[trace_event_count].name, name, MAX_EVENT_NAME - 1);
47 event_count++; 47 trace_event_count++;
48 return 0; 48 return 0;
49} 49}
50 50
51char *perf_header__find_event(u64 id) 51char *perf_header__find_event(u64 id)
52{ 52{
53 int i; 53 int i;
54 for (i = 0 ; i < event_count; i++) { 54 for (i = 0 ; i < trace_event_count; i++) {
55 if (events[i].event_id == id) 55 if (trace_events[i].event_id == id)
56 return events[i].name; 56 return trace_events[i].name;
57 } 57 }
58 return NULL; 58 return NULL;
59} 59}
@@ -1726,9 +1726,9 @@ out_err_write:
1726 } 1726 }
1727 1727
1728 header->event_offset = lseek(fd, 0, SEEK_CUR); 1728 header->event_offset = lseek(fd, 0, SEEK_CUR);
1729 header->event_size = event_count * sizeof(struct perf_trace_event_type); 1729 header->event_size = trace_event_count * sizeof(struct perf_trace_event_type);
1730 if (events) { 1730 if (trace_events) {
1731 err = do_write(fd, events, header->event_size); 1731 err = do_write(fd, trace_events, header->event_size);
1732 if (err < 0) { 1732 if (err < 0) {
1733 pr_debug("failed to write perf header events\n"); 1733 pr_debug("failed to write perf header events\n");
1734 return err; 1734 return err;
@@ -2211,13 +2211,13 @@ int perf_session__read_header(struct perf_session *session, int fd)
2211 2211
2212 if (f_header.event_types.size) { 2212 if (f_header.event_types.size) {
2213 lseek(fd, f_header.event_types.offset, SEEK_SET); 2213 lseek(fd, f_header.event_types.offset, SEEK_SET);
2214 events = malloc(f_header.event_types.size); 2214 trace_events = malloc(f_header.event_types.size);
2215 if (events == NULL) 2215 if (trace_events == NULL)
2216 return -ENOMEM; 2216 return -ENOMEM;
2217 if (perf_header__getbuffer64(header, fd, events, 2217 if (perf_header__getbuffer64(header, fd, trace_events,
2218 f_header.event_types.size)) 2218 f_header.event_types.size))
2219 goto out_errno; 2219 goto out_errno;
2220 event_count = f_header.event_types.size / sizeof(struct perf_trace_event_type); 2220 trace_event_count = f_header.event_types.size / sizeof(struct perf_trace_event_type);
2221 } 2221 }
2222 2222
2223 perf_header__process_sections(header, fd, &session->pevent, 2223 perf_header__process_sections(header, fd, &session->pevent,
@@ -2362,8 +2362,8 @@ int perf_event__synthesize_event_types(struct perf_tool *tool,
2362 struct perf_trace_event_type *type; 2362 struct perf_trace_event_type *type;
2363 int i, err = 0; 2363 int i, err = 0;
2364 2364
2365 for (i = 0; i < event_count; i++) { 2365 for (i = 0; i < trace_event_count; i++) {
2366 type = &events[i]; 2366 type = &trace_events[i];
2367 2367
2368 err = perf_event__synthesize_event_type(tool, type->event_id, 2368 err = perf_event__synthesize_event_type(tool, type->event_id,
2369 type->name, process, 2369 type->name, process,