Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185906
b: refs/heads/master
c: 804b360
h: refs/heads/master
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Feb 25, 2010
1 parent b7247e0 commit c5bd82a
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 467 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81cb8aa327b5923b38eccc795c8b7170be20b9ff
refs/heads/master: 804b36068eccd8163ccea420c662fb5d1a21b141
10 changes: 5 additions & 5 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,12 @@ else
msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
endif

ifneq ($(shell sh -c "(echo '\#ifndef _MIPS_SZLONG'; echo '\#define _MIPS_SZLONG 0'; echo '\#endif'; echo '\#include <dwarf.h>'; echo '\#include <libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/libdwarf -ldwarf -lelf -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231);
BASIC_CFLAGS += -DNO_LIBDWARF
ifneq ($(shell sh -c "(echo '\#include <dwarf.h>'; echo '\#include <libdw.h>'; echo 'int main(void) { Dwarf *dbg; dbg = dwarf_begin(0, DWARF_C_READ); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/elfutils -ldw -lelf -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
msg := $(warning No libdw.h found or old libdw.h found, disables dwarf support. Please install elfutils-devel/elfutils-dev);
BASIC_CFLAGS += -DNO_DWARF_SUPPORT
else
BASIC_CFLAGS += -I/usr/include/libdwarf
EXTLIBS += -lelf -ldwarf
BASIC_CFLAGS += -I/usr/include/elfutils
EXTLIBS += -lelf -ldw
LIB_OBJS += util/probe-finder.o
endif

Expand Down
22 changes: 11 additions & 11 deletions trunk/tools/perf/builtin-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void evaluate_probe_point(struct probe_point *pp)
pp->function);
}

#ifndef NO_LIBDWARF
#ifndef NO_DWARF_SUPPORT
static int open_vmlinux(void)
{
if (map__load(session.kmaps[MAP__FUNCTION], NULL) < 0) {
Expand Down Expand Up @@ -156,7 +156,7 @@ static const char * const probe_usage[] = {
"perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]",
"perf probe [<options>] --del '[GROUP:]EVENT' ...",
"perf probe --list",
#ifndef NO_LIBDWARF
#ifndef NO_DWARF_SUPPORT
"perf probe --line 'LINEDESC'",
#endif
NULL
Expand All @@ -165,7 +165,7 @@ static const char * const probe_usage[] = {
static const struct option options[] = {
OPT_BOOLEAN('v', "verbose", &verbose,
"be more verbose (show parsed arguments, etc)"),
#ifndef NO_LIBDWARF
#ifndef NO_DWARF_SUPPORT
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
"file", "vmlinux pathname"),
#endif
Expand All @@ -174,7 +174,7 @@ static const struct option options[] = {
OPT_CALLBACK('d', "del", NULL, "[GROUP:]EVENT", "delete a probe event.",
opt_del_probe_event),
OPT_CALLBACK('a', "add", NULL,
#ifdef NO_LIBDWARF
#ifdef NO_DWARF_SUPPORT
"[EVENT=]FUNC[+OFFS|%return] [ARG ...]",
#else
"[EVENT=]FUNC[+OFFS|%return|:RLN][@SRC]|SRC:ALN [ARG ...]",
Expand All @@ -185,7 +185,7 @@ static const struct option options[] = {
"\t\tFUNC:\tFunction name\n"
"\t\tOFFS:\tOffset from function entry (in byte)\n"
"\t\t%return:\tPut the probe at function return\n"
#ifdef NO_LIBDWARF
#ifdef NO_DWARF_SUPPORT
"\t\tARG:\tProbe argument (only \n"
#else
"\t\tSRC:\tSource code path\n"
Expand All @@ -197,7 +197,7 @@ static const struct option options[] = {
opt_add_probe_event),
OPT_BOOLEAN('f', "force", &session.force_add, "forcibly add events"
" with existing name"),
#ifndef NO_LIBDWARF
#ifndef NO_DWARF_SUPPORT
OPT_CALLBACK('L', "line", NULL,
"FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]",
"Show source code lines.", opt_show_lines),
Expand Down Expand Up @@ -225,7 +225,7 @@ static void init_vmlinux(void)
int cmd_probe(int argc, const char **argv, const char *prefix __used)
{
int i, ret;
#ifndef NO_LIBDWARF
#ifndef NO_DWARF_SUPPORT
int fd;
#endif
struct probe_point *pp;
Expand Down Expand Up @@ -261,7 +261,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
return 0;
}

#ifndef NO_LIBDWARF
#ifndef NO_DWARF_SUPPORT
if (session.show_lines) {
if (session.nr_probe != 0 || session.dellist) {
pr_warning(" Error: Don't use --line with"
Expand Down Expand Up @@ -292,9 +292,9 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
init_vmlinux();

if (session.need_dwarf)
#ifdef NO_LIBDWARF
#ifdef NO_DWARF_SUPPORT
die("Debuginfo-analysis is not supported");
#else /* !NO_LIBDWARF */
#else /* !NO_DWARF_SUPPORT */
pr_debug("Some probes require debuginfo.\n");

fd = open_vmlinux();
Expand Down Expand Up @@ -335,7 +335,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
close(fd);

end_dwarf:
#endif /* !NO_LIBDWARF */
#endif /* !NO_DWARF_SUPPORT */

/* Synthesize probes without dwarf */
for (i = 0; i < session.nr_probe; i++) {
Expand Down
Loading

0 comments on commit c5bd82a

Please sign in to comment.