Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169856
b: refs/heads/master
c: 16c632d
h: refs/heads/master
v: v3
  • Loading branch information
Tom Zanussi authored and Ingo Molnar committed Nov 28, 2009
1 parent 5b68cb3 commit 394869c
Show file tree
Hide file tree
Showing 7 changed files with 630 additions and 6 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: eb9a42caa7a926beb935a22bc59d981b35f0b652
refs/heads/master: 16c632de64a74644a46e7636db26b2cfb530ca13
13 changes: 13 additions & 0 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ LIB_OBJS += util/thread.o
LIB_OBJS += util/trace-event-parse.o
LIB_OBJS += util/trace-event-read.o
LIB_OBJS += util/trace-event-info.o
LIB_OBJS += util/trace-event-perl.o
LIB_OBJS += util/svghelper.o
LIB_OBJS += util/sort.o
LIB_OBJS += util/hist.o
Expand Down Expand Up @@ -489,6 +490,15 @@ else
LIB_OBJS += util/probe-finder.o
endif

PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts`
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts`

ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; echo 'int main(void) { perl_alloc(); return 0; }') | $(CC) -x c - $(PERL_EMBED_CCOPTS) -o /dev/null $(PERL_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y)
BASIC_CFLAGS += -DNO_LIBPERL
else
ALL_LDFLAGS += $(PERL_EMBED_LDOPTS)
endif

ifdef NO_DEMANGLE
BASIC_CFLAGS += -DNO_DEMANGLE
else
Expand Down Expand Up @@ -860,6 +870,9 @@ util/hweight.o: ../../lib/hweight.c PERF-CFLAGS
util/find_next_bit.o: ../../lib/find_next_bit.c PERF-CFLAGS
$(QUIET_CC)$(CC) -o util/find_next_bit.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<

util/trace-event-perl.o: util/trace-event-perl.c PERF-CFLAGS
$(QUIET_CC)$(CC) -o util/trace-event-perl.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter $<

perf-%$X: %.o $(PERFLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)

Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static void setup_scripting(void)
/* make sure PERF_EXEC_PATH is set for scripts */
perf_set_argv_exec_path(perf_exec_path());

setup_perl_scripting();

scripting_ops = &default_scripting_ops;
}

Expand Down
18 changes: 13 additions & 5 deletions trunk/tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,7 @@ find_any_field(struct event *event, const char *name)
return find_field(event, name);
}

static unsigned long long read_size(void *ptr, int size)
unsigned long long read_size(void *ptr, int size)
{
switch (size) {
case 1:
Expand Down Expand Up @@ -1973,7 +1973,7 @@ int trace_parse_common_type(void *data)
"common_type");
}

static int parse_common_pid(void *data)
int trace_parse_common_pid(void *data)
{
static int pid_offset;
static int pid_size;
Expand Down Expand Up @@ -2025,6 +2025,14 @@ struct event *trace_find_event(int id)
return event;
}

struct event *trace_find_next_event(struct event *event)
{
if (!event)
return event_list;

return event->next;
}

static unsigned long long eval_num_arg(void *data, int size,
struct event *event, struct print_arg *arg)
{
Expand Down Expand Up @@ -2164,7 +2172,7 @@ static const struct flag flags[] = {
{ "HRTIMER_RESTART", 1 },
};

static unsigned long long eval_flag(const char *flag)
unsigned long long eval_flag(const char *flag)
{
int i;

Expand Down Expand Up @@ -2694,7 +2702,7 @@ get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func,
if (!(event->flags & EVENT_FL_ISFUNCRET))
return NULL;

pid = parse_common_pid(next->data);
pid = trace_parse_common_pid(next->data);
field = find_field(event, "func");
if (!field)
die("function return does not have field func");
Expand Down Expand Up @@ -2980,7 +2988,7 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs,
return;
}

pid = parse_common_pid(data);
pid = trace_parse_common_pid(data);

if (event->flags & (EVENT_FL_ISFUNCENT | EVENT_FL_ISFUNCRET))
return pretty_print_func_graph(data, size, event, cpu,
Expand Down
Loading

0 comments on commit 394869c

Please sign in to comment.