aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-26 03:19:13 -0400
committerIngo Molnar <mingo@kernel.org>2017-08-26 03:19:13 -0400
commit413d63d71b222108d19703f3fd5cf9108652a730 (patch)
tree4680de6aebb6430dc5f3d9327f86d65149e6b5ae /tools/perf
parentd6c8103b0265d8db30e20e948a4f06382bbdaea7 (diff)
parent90a6cd503982bfd33ce8c70eb49bd2dd33bc6325 (diff)
Merge branch 'linus' into x86/mm to pick up fixes and to fix conflicts
Conflicts: arch/x86/kernel/head64.c arch/x86/mm/mmap.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/ui/browser.c2
-rw-r--r--tools/perf/util/evsel.c8
-rw-r--r--tools/perf/util/machine.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index a4d3762cd825..83874b0e266c 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -704,7 +704,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
704 ui_browser__gotorc(browser, row, column + 1); 704 ui_browser__gotorc(browser, row, column + 1);
705 SLsmg_draw_hline(2); 705 SLsmg_draw_hline(2);
706 706
707 if (row++ == 0) 707 if (++row == 0)
708 goto out; 708 goto out;
709 } else 709 } else
710 row = 0; 710 row = 0;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 87b431886670..413f74df08de 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -273,7 +273,7 @@ struct perf_evsel *perf_evsel__new_cycles(void)
273 struct perf_event_attr attr = { 273 struct perf_event_attr attr = {
274 .type = PERF_TYPE_HARDWARE, 274 .type = PERF_TYPE_HARDWARE,
275 .config = PERF_COUNT_HW_CPU_CYCLES, 275 .config = PERF_COUNT_HW_CPU_CYCLES,
276 .exclude_kernel = 1, 276 .exclude_kernel = geteuid() != 0,
277 }; 277 };
278 struct perf_evsel *evsel; 278 struct perf_evsel *evsel;
279 279
@@ -298,8 +298,10 @@ struct perf_evsel *perf_evsel__new_cycles(void)
298 goto out; 298 goto out;
299 299
300 /* use asprintf() because free(evsel) assumes name is allocated */ 300 /* use asprintf() because free(evsel) assumes name is allocated */
301 if (asprintf(&evsel->name, "cycles%.*s", 301 if (asprintf(&evsel->name, "cycles%s%s%.*s",
302 attr.precise_ip ? attr.precise_ip + 1 : 0, ":ppp") < 0) 302 (attr.precise_ip || attr.exclude_kernel) ? ":" : "",
303 attr.exclude_kernel ? "u" : "",
304 attr.precise_ip ? attr.precise_ip + 1 : 0, "ppp") < 0)
303 goto error_free; 305 goto error_free;
304out: 306out:
305 return evsel; 307 return evsel;
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 5de2b86b9880..2e9eb6aa3ce2 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -2209,7 +2209,7 @@ int machine__get_kernel_start(struct machine *machine)
2209 machine->kernel_start = 1ULL << 63; 2209 machine->kernel_start = 1ULL << 63;
2210 if (map) { 2210 if (map) {
2211 err = map__load(map); 2211 err = map__load(map);
2212 if (map->start) 2212 if (!err)
2213 machine->kernel_start = map->start; 2213 machine->kernel_start = map->start;
2214 } 2214 }
2215 return err; 2215 return err;