aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index fb126459b134..badfabc6a01f 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1846,7 +1846,7 @@ static int trace__pgfault(struct trace *trace,
1846 if (trace->summary_only) 1846 if (trace->summary_only)
1847 return 0; 1847 return 0;
1848 1848
1849 thread__find_addr_location(thread, trace->host, cpumode, MAP__FUNCTION, 1849 thread__find_addr_location(thread, cpumode, MAP__FUNCTION,
1850 sample->ip, &al); 1850 sample->ip, &al);
1851 1851
1852 trace__fprintf_entry_head(trace, thread, 0, sample->time, trace->output); 1852 trace__fprintf_entry_head(trace, thread, 0, sample->time, trace->output);
@@ -1859,11 +1859,11 @@ static int trace__pgfault(struct trace *trace,
1859 1859
1860 fprintf(trace->output, "] => "); 1860 fprintf(trace->output, "] => ");
1861 1861
1862 thread__find_addr_location(thread, trace->host, cpumode, MAP__VARIABLE, 1862 thread__find_addr_location(thread, cpumode, MAP__VARIABLE,
1863 sample->addr, &al); 1863 sample->addr, &al);
1864 1864
1865 if (!al.map) { 1865 if (!al.map) {
1866 thread__find_addr_location(thread, trace->host, cpumode, 1866 thread__find_addr_location(thread, cpumode,
1867 MAP__FUNCTION, sample->addr, &al); 1867 MAP__FUNCTION, sample->addr, &al);
1868 1868
1869 if (al.map) 1869 if (al.map)
@@ -2045,7 +2045,6 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2045 unsigned long before; 2045 unsigned long before;
2046 const bool forks = argc > 0; 2046 const bool forks = argc > 0;
2047 bool draining = false; 2047 bool draining = false;
2048 char sbuf[STRERR_BUFSIZE];
2049 2048
2050 trace->live = true; 2049 trace->live = true;
2051 2050
@@ -2106,11 +2105,8 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2106 goto out_error_open; 2105 goto out_error_open;
2107 2106
2108 err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false); 2107 err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false);
2109 if (err < 0) { 2108 if (err < 0)
2110 fprintf(trace->output, "Couldn't mmap the events: %s\n", 2109 goto out_error_mmap;
2111 strerror_r(errno, sbuf, sizeof(sbuf)));
2112 goto out_delete_evlist;
2113 }
2114 2110
2115 perf_evlist__enable(evlist); 2111 perf_evlist__enable(evlist);
2116 2112
@@ -2210,6 +2206,10 @@ out_error_tp:
2210 perf_evlist__strerror_tp(evlist, errno, errbuf, sizeof(errbuf)); 2206 perf_evlist__strerror_tp(evlist, errno, errbuf, sizeof(errbuf));
2211 goto out_error; 2207 goto out_error;
2212 2208
2209out_error_mmap:
2210 perf_evlist__strerror_mmap(evlist, errno, errbuf, sizeof(errbuf));
2211 goto out_error;
2212
2213out_error_open: 2213out_error_open:
2214 perf_evlist__strerror_open(evlist, errno, errbuf, sizeof(errbuf)); 2214 perf_evlist__strerror_open(evlist, errno, errbuf, sizeof(errbuf));
2215 2215
@@ -2485,7 +2485,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused)
2485 .user_freq = UINT_MAX, 2485 .user_freq = UINT_MAX,
2486 .user_interval = ULLONG_MAX, 2486 .user_interval = ULLONG_MAX,
2487 .no_buffering = true, 2487 .no_buffering = true,
2488 .mmap_pages = 1024, 2488 .mmap_pages = UINT_MAX,
2489 }, 2489 },
2490 .output = stdout, 2490 .output = stdout,
2491 .show_comm = true, 2491 .show_comm = true,