Skip to content

Commit

Permalink
perf_counter: Fix the tracepoint channel to perfcounters
Browse files Browse the repository at this point in the history
Fix a missed rename in EVENT_PROFILE support so that it gets
built and allows tracepoint tracing from the 'perf' tool.

Fix a typo in the (never before built & enabled) portion in
perf_counter.c as well, and update that code to the
attr.config changes as well.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Ben Gamari <[email protected]>
Cc: Jason Baron <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Steven Rostedt <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
ickle authored and Ingo Molnar committed Jul 13, 2009
1 parent 9590b7b commit d4d7d0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ config PERF_COUNTERS

config EVENT_PROFILE
bool "Tracepoint profile sources"
depends on PERF_COUNTERS && EVENT_TRACER
depends on PERF_COUNTERS && EVENT_TRACING
default y

endmenu
Expand Down
10 changes: 3 additions & 7 deletions kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -3671,7 +3671,7 @@ static const struct pmu perf_ops_task_clock = {
void perf_tpcounter_event(int event_id)
{
struct perf_sample_data data = {
.regs = get_irq_regs();
.regs = get_irq_regs(),
.addr = 0,
};

Expand All @@ -3687,16 +3687,12 @@ extern void ftrace_profile_disable(int);

static void tp_perf_counter_destroy(struct perf_counter *counter)
{
ftrace_profile_disable(perf_event_id(&counter->attr));
ftrace_profile_disable(counter->attr.config);
}

static const struct pmu *tp_perf_counter_init(struct perf_counter *counter)
{
int event_id = perf_event_id(&counter->attr);
int ret;

ret = ftrace_profile_enable(event_id);
if (ret)
if (ftrace_profile_enable(counter->attr.config))
return NULL;

counter->destroy = tp_perf_counter_destroy;
Expand Down

0 comments on commit d4d7d0b

Please sign in to comment.