Commit d46c7d9a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'perfcounters-fixes-for-linus-2' of...

Merge branch 'perfcounters-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perfcounters-fixes-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf tools: Make 'make html' work
  perf annotate: Fix segmentation fault
  perf_counter: Fix the PARISC build
  perf_counter: Check task on counter read IPI
  perf: Rename perf-examples.txt to examples.txt
  perf record: Fix typo in pid_synthesize_comm_event
parents c124891f b395cd8a
...@@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task) ...@@ -1503,10 +1503,21 @@ static void perf_counter_enable_on_exec(struct task_struct *task)
*/ */
static void __perf_counter_read(void *info) static void __perf_counter_read(void *info)
{ {
struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
struct perf_counter *counter = info; struct perf_counter *counter = info;
struct perf_counter_context *ctx = counter->ctx; struct perf_counter_context *ctx = counter->ctx;
unsigned long flags; unsigned long flags;
/*
* If this is a task context, we need to check whether it is
* the current task context of this cpu. If not it has been
* scheduled out before the smp call arrived. In that case
* counter->count would have been updated to a recent sample
* when the counter was scheduled out.
*/
if (ctx->task && cpuctx->task_ctx != ctx)
return;
local_irq_save(flags); local_irq_save(flags);
if (ctx->is_active) if (ctx->is_active)
update_context_time(ctx); update_context_time(ctx);
...@@ -2008,6 +2019,10 @@ int perf_counter_task_disable(void) ...@@ -2008,6 +2019,10 @@ int perf_counter_task_disable(void)
return 0; return 0;
} }
#ifndef PERF_COUNTER_INDEX_OFFSET
# define PERF_COUNTER_INDEX_OFFSET 0
#endif
static int perf_counter_index(struct perf_counter *counter) static int perf_counter_index(struct perf_counter *counter)
{ {
if (counter->state != PERF_COUNTER_STATE_ACTIVE) if (counter->state != PERF_COUNTER_STATE_ACTIVE)
......
...@@ -35,7 +35,7 @@ man7dir=$(mandir)/man7 ...@@ -35,7 +35,7 @@ man7dir=$(mandir)/man7
# DESTDIR= # DESTDIR=
ASCIIDOC=asciidoc ASCIIDOC=asciidoc
ASCIIDOC_EXTRA = ASCIIDOC_EXTRA = --unsafe
MANPAGE_XSL = manpage-normal.xsl MANPAGE_XSL = manpage-normal.xsl
XMLTO_EXTRA = XMLTO_EXTRA =
INSTALL?=install INSTALL?=install
......
...@@ -980,6 +980,13 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head) ...@@ -980,6 +980,13 @@ process_fork_event(event_t *event, unsigned long offset, unsigned long head)
(void *)(long)(event->header.size), (void *)(long)(event->header.size),
event->fork.pid, event->fork.ppid); event->fork.pid, event->fork.ppid);
/*
* A thread clone will have the same PID for both
* parent and child.
*/
if (thread == parent)
return 0;
if (!thread || !parent || thread__fork(thread, parent)) { if (!thread || !parent || thread__fork(thread, parent)) {
dprintf("problem processing PERF_EVENT_FORK, skipping event.\n"); dprintf("problem processing PERF_EVENT_FORK, skipping event.\n");
return -1; return -1;
......
...@@ -219,7 +219,7 @@ static pid_t pid_synthesize_comm_event(pid_t pid, int full) ...@@ -219,7 +219,7 @@ static pid_t pid_synthesize_comm_event(pid_t pid, int full)
snprintf(filename, sizeof(filename), "/proc/%d/status", pid); snprintf(filename, sizeof(filename), "/proc/%d/status", pid);
fp = fopen(filename, "r"); fp = fopen(filename, "r");
if (fd == NULL) { if (fp == NULL) {
/* /*
* We raced with a task exiting - just return: * We raced with a task exiting - just return:
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment