diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-04-25 12:28:13 +0900 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-04-28 13:42:29 +0200 |
commit | 6e344a952dcfa45b8bfef8eaf8423ab73c5adaf2 (patch) | |
tree | af0200fd0df2a89def1a0a87a1c39309edfe430e /tools/perf/tests/hists_common.h | |
parent | 2933d7813d8618f18632a7dc7f4e7f1f7d17383a (diff) |
perf tests: Factor out fake_setup_machine()
The fake_setup_machine() is for setting up a environment for testing
various hists operations. As it'll be used for other test cases it'd
better factoring it out.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1398396494-12811-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/tests/hists_common.h')
-rw-r--r-- | tools/perf/tests/hists_common.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/perf/tests/hists_common.h b/tools/perf/tests/hists_common.h new file mode 100644 index 000000000000..2528b8fc105a --- /dev/null +++ b/tools/perf/tests/hists_common.h @@ -0,0 +1,44 @@ +#ifndef __PERF_TESTS__HISTS_COMMON_H__ +#define __PERF_TESTS__HISTS_COMMON_H__ + +struct machine; +struct machines; + +/* + * The setup_fake_machine() provides a test environment which consists + * of 3 processes that have 3 mappings and in turn, have 3 symbols + * respectively. See below table: + * + * Command: Pid Shared Object Symbol + * ............. ............. ................... + * perf: 100 perf main + * perf: 100 perf run_command + * perf: 100 perf comd_record + * perf: 100 libc malloc + * perf: 100 libc free + * perf: 100 libc realloc + * perf: 100 [kernel] schedule + * perf: 100 [kernel] page_fault + * perf: 100 [kernel] sys_perf_event_open + * perf: 200 perf main + * perf: 200 perf run_command + * perf: 200 perf comd_record + * perf: 200 libc malloc + * perf: 200 libc free + * perf: 200 libc realloc + * perf: 200 [kernel] schedule + * perf: 200 [kernel] page_fault + * perf: 200 [kernel] sys_perf_event_open + * bash: 300 bash main + * bash: 300 bash xmalloc + * bash: 300 bash xfree + * bash: 300 libc malloc + * bash: 300 libc free + * bash: 300 libc realloc + * bash: 300 [kernel] schedule + * bash: 300 [kernel] page_fault + * bash: 300 [kernel] sys_perf_event_open + */ +struct machine *setup_fake_machine(struct machines *machines); + +#endif /* __PERF_TESTS__HISTS_COMMON_H__ */ |