2009-04-20 13:00:56 +00:00
|
|
|
#ifndef BUILTIN_H
|
|
|
|
#define BUILTIN_H
|
|
|
|
|
2009-04-27 06:02:14 +00:00
|
|
|
#include "util/util.h"
|
|
|
|
#include "util/strbuf.h"
|
2009-04-20 13:00:56 +00:00
|
|
|
|
|
|
|
extern const char perf_version_string[];
|
|
|
|
extern const char perf_usage_string[];
|
|
|
|
extern const char perf_more_info_string[];
|
|
|
|
|
|
|
|
extern void list_common_cmds_help(void);
|
|
|
|
extern const char *help_unknown_cmd(const char *cmd);
|
|
|
|
extern void prune_packed_objects(int);
|
|
|
|
extern int read_line_with_nul(char *buf, int size, FILE *file);
|
|
|
|
extern int check_pager_config(const char *cmd);
|
|
|
|
|
2009-06-06 13:19:13 +00:00
|
|
|
extern int cmd_annotate(int argc, const char **argv, const char *prefix);
|
2009-11-05 00:31:35 +00:00
|
|
|
extern int cmd_bench(int argc, const char **argv, const char *prefix);
|
2010-01-20 17:28:45 +00:00
|
|
|
extern int cmd_buildid_cache(int argc, const char **argv, const char *prefix);
|
2009-11-16 18:32:45 +00:00
|
|
|
extern int cmd_buildid_list(int argc, const char **argv, const char *prefix);
|
2009-12-14 22:09:31 +00:00
|
|
|
extern int cmd_diff(int argc, const char **argv, const char *prefix);
|
2009-04-20 14:05:55 +00:00
|
|
|
extern int cmd_help(int argc, const char **argv, const char *prefix);
|
2009-09-11 10:12:54 +00:00
|
|
|
extern int cmd_sched(int argc, const char **argv, const char *prefix);
|
|
|
|
extern int cmd_list(int argc, const char **argv, const char *prefix);
|
2009-04-20 13:58:01 +00:00
|
|
|
extern int cmd_record(int argc, const char **argv, const char *prefix);
|
2009-05-18 15:45:42 +00:00
|
|
|
extern int cmd_report(int argc, const char **argv, const char *prefix);
|
2009-04-20 13:52:29 +00:00
|
|
|
extern int cmd_stat(int argc, const char **argv, const char *prefix);
|
2009-09-12 05:53:05 +00:00
|
|
|
extern int cmd_timechart(int argc, const char **argv, const char *prefix);
|
2009-04-20 13:58:01 +00:00
|
|
|
extern int cmd_top(int argc, const char **argv, const char *prefix);
|
2010-11-16 17:45:39 +00:00
|
|
|
extern int cmd_script(int argc, const char **argv, const char *prefix);
|
2009-09-11 10:12:54 +00:00
|
|
|
extern int cmd_version(int argc, const char **argv, const char *prefix);
|
2009-10-08 21:17:38 +00:00
|
|
|
extern int cmd_probe(int argc, const char **argv, const char *prefix);
|
2009-11-20 07:53:25 +00:00
|
|
|
extern int cmd_kmem(int argc, const char **argv, const char *prefix);
|
2010-01-30 11:43:33 +00:00
|
|
|
extern int cmd_lock(int argc, const char **argv, const char *prefix);
|
2010-04-19 05:32:50 +00:00
|
|
|
extern int cmd_kvm(int argc, const char **argv, const char *prefix);
|
perf test: Initial regression testing command
First an example with the first internal test:
[acme@doppio linux-2.6-tip]$ perf test
1: vmlinux symtab matches kallsyms: Ok
So it run just one test, that is "vmlinux symtab matches kallsyms", and it was
successful.
If we run it in verbose mode, we'll see details about errors and extra warnings
for non-fatal problems:
[acme@doppio linux-2.6-tip]$ perf test -v
1: vmlinux symtab matches kallsyms:
--- start ---
Looking at the vmlinux_path (5 entries long)
No build_id in vmlinux, ignoring it
No build_id in /boot/vmlinux, ignoring it
No build_id in /boot/vmlinux-2.6.34-rc4-tip+, ignoring it
Using /lib/modules/2.6.34-rc4-tip+/build/vmlinux for symbols
Maps only in vmlinux:
ffffffff81cb81b1-ffffffff81e1149b 0 [kernel].init.text
ffffffff81e1149c-ffffffff9fffffff 0 [kernel].exit.text
ffffffffff600000-ffffffffff6000ff 0 [kernel].vsyscall_0
ffffffffff600100-ffffffffff6003ff 0 [kernel].vsyscall_fn
ffffffffff600400-ffffffffff6007ff 0 [kernel].vsyscall_1
ffffffffff600800-ffffffffffffffff 0 [kernel].vsyscall_2
Maps in vmlinux with a different name in kallsyms:
ffffffffff600000-ffffffffff6000ff 0 [kernel].vsyscall_0 in kallsyms as [kernel].0
ffffffffff600100-ffffffffff6003ff 0 [kernel].vsyscall_fn in kallsyms as:
*ffffffffff600100-ffffffffff60012f 0 [kernel].2
ffffffffff600400-ffffffffff6007ff 0 [kernel].vsyscall_1 in kallsyms as [kernel].6
ffffffffff600800-ffffffffffffffff 0 [kernel].vsyscall_2 in kallsyms as [kernel].8
Maps only in kallsyms:
ffffffffff600130-ffffffffff6003ff 0 [kernel].4
---- end ----
vmlinux symtab matches kallsyms: Ok
[acme@doppio linux-2.6-tip]$
In the above case we only know the name of the non contiguous kernel ranges in
the address space when reading the symbol information from the ELF symtab in
vmlinux.
The /proc/kallsyms file lack this, we only notice they are separate because
there are modules after the kernel and after that more kernel functions, so we
need to have a module rbtree backed by the module .ko path to get symtabs in
the vmlinux case.
The tool uses it to match by address to emit appropriate warning, but don't
considers this fatal.
The .init.text and .exit.text ines, of course, aren't in kallsyms, so I left
these cases just as extra info in verbose mode.
The end of the sections also aren't in kallsyms, so we the symbols layer does
another pass and sets the end addresses as the next map start minus one, which
sometimes pads, causing harmless mismatches.
But at least the symbols match, tested it by copying /proc/kallsyms to
/tmp/kallsyms and doing changes to see if they were detected.
This first test also should serve as a first stab at documenting the
symbol library by providing a self contained example that exercises it
together with comments about what is being done.
More tests to check if actions done on a monitored app, like doing mmaps, etc,
makes the kernel generate the expected events should be added next.
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-04-29 21:58:32 +00:00
|
|
|
extern int cmd_test(int argc, const char **argv, const char *prefix);
|
2010-05-01 06:41:20 +00:00
|
|
|
extern int cmd_inject(int argc, const char **argv, const char *prefix);
|
2009-06-06 10:24:17 +00:00
|
|
|
|
2009-04-20 13:00:56 +00:00
|
|
|
#endif
|