summaryrefslogtreecommitdiff
path: root/tools/perf/tests/hists_output.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-05-23 05:59:57 (GMT)
committerJiri Olsa <jolsa@kernel.org>2014-06-01 12:35:11 (GMT)
commita1891aa4805fa77d98db44ec6e1d93e2921828fb (patch)
tree13faa52fccc2ed620f89e8c71030c85718daaeb0 /tools/perf/tests/hists_output.c
parentd69b2962a0aebd431cdda939f4418dd606e2f77e (diff)
downloadlinux-a1891aa4805fa77d98db44ec6e1d93e2921828fb.tar.xz
perf tests: Define and use symbolic names for fake symbols
In various histogram test cases, fake symbols are used as raw numbers. Define macros for each pid, map, symbols so that it can increase readability somewhat. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Arun Sharma <asharma@fb.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/1401335910-16832-27-git-send-email-namhyung@kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/tests/hists_output.c')
-rw-r--r--tools/perf/tests/hists_output.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index d40461e..e3bbd6c 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -22,25 +22,25 @@ struct sample {
/* For the numbers, see hists_common.c */
static struct sample fake_samples[] = {
/* perf [kernel] schedule() */
- { .cpu = 0, .pid = 100, .ip = 0xf0000 + 700, },
+ { .cpu = 0, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_KERNEL_SCHEDULE, },
/* perf [perf] main() */
- { .cpu = 1, .pid = 100, .ip = 0x40000 + 700, },
+ { .cpu = 1, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_PERF_MAIN, },
/* perf [perf] cmd_record() */
- { .cpu = 1, .pid = 100, .ip = 0x40000 + 900, },
+ { .cpu = 1, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_PERF_CMD_RECORD, },
/* perf [libc] malloc() */
- { .cpu = 1, .pid = 100, .ip = 0x50000 + 700, },
+ { .cpu = 1, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_LIBC_MALLOC, },
/* perf [libc] free() */
- { .cpu = 2, .pid = 100, .ip = 0x50000 + 800, },
+ { .cpu = 2, .pid = FAKE_PID_PERF1, .ip = FAKE_IP_LIBC_FREE, },
/* perf [perf] main() */
- { .cpu = 2, .pid = 200, .ip = 0x40000 + 700, },
+ { .cpu = 2, .pid = FAKE_PID_PERF2, .ip = FAKE_IP_PERF_MAIN, },
/* perf [kernel] page_fault() */
- { .cpu = 2, .pid = 200, .ip = 0xf0000 + 800, },
+ { .cpu = 2, .pid = FAKE_PID_PERF2, .ip = FAKE_IP_KERNEL_PAGE_FAULT, },
/* bash [bash] main() */
- { .cpu = 3, .pid = 300, .ip = 0x40000 + 700, },
+ { .cpu = 3, .pid = FAKE_PID_BASH, .ip = FAKE_IP_BASH_MAIN, },
/* bash [bash] xmalloc() */
- { .cpu = 0, .pid = 300, .ip = 0x40000 + 800, },
+ { .cpu = 0, .pid = FAKE_PID_BASH, .ip = FAKE_IP_BASH_XMALLOC, },
/* bash [kernel] page_fault() */
- { .cpu = 1, .pid = 300, .ip = 0xf0000 + 800, },
+ { .cpu = 1, .pid = FAKE_PID_BASH, .ip = FAKE_IP_KERNEL_PAGE_FAULT, },
};
static int add_hist_entries(struct hists *hists, struct machine *machine)