diff options
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index c2e02319347a..41c9bde2fb67 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "util/session.h" | 36 | #include "util/session.h" |
37 | #include "util/svghelper.h" | 37 | #include "util/svghelper.h" |
38 | #include "util/tool.h" | 38 | #include "util/tool.h" |
39 | #include "util/data.h" | ||
39 | 40 | ||
40 | #define SUPPORT_OLD_POWER_EVENTS 1 | 41 | #define SUPPORT_OLD_POWER_EVENTS 1 |
41 | #define PWR_EVENT_EXIT -1 | 42 | #define PWR_EVENT_EXIT -1 |
@@ -482,8 +483,8 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, | |||
482 | if (sample->cpu > numcpus) | 483 | if (sample->cpu > numcpus) |
483 | numcpus = sample->cpu; | 484 | numcpus = sample->cpu; |
484 | 485 | ||
485 | if (evsel->handler.func != NULL) { | 486 | if (evsel->handler != NULL) { |
486 | tracepoint_handler f = evsel->handler.func; | 487 | tracepoint_handler f = evsel->handler; |
487 | return f(evsel, sample); | 488 | return f(evsel, sample); |
488 | } | 489 | } |
489 | 490 | ||
@@ -990,8 +991,13 @@ static int __cmd_timechart(const char *output_name) | |||
990 | { "power:power_frequency", process_sample_power_frequency }, | 991 | { "power:power_frequency", process_sample_power_frequency }, |
991 | #endif | 992 | #endif |
992 | }; | 993 | }; |
993 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, | 994 | struct perf_data_file file = { |
994 | 0, false, &perf_timechart); | 995 | .path = input_name, |
996 | .mode = PERF_DATA_MODE_READ, | ||
997 | }; | ||
998 | |||
999 | struct perf_session *session = perf_session__new(&file, false, | ||
1000 | &perf_timechart); | ||
995 | int ret = -EINVAL; | 1001 | int ret = -EINVAL; |
996 | 1002 | ||
997 | if (session == NULL) | 1003 | if (session == NULL) |