On 12/11/13, 5:36 AM, Alexander Shishkin wrote:

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 55f3608..52fbfb6 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1412,3 +1412,29 @@ pid_t machine__get_thread_pid(struct machine *machine, 
pid_t tid)

        return thread->pid_;
  }
+
+int machine__get_thread_cpu(struct machine *machine, pid_t tid, pid_t *pid)
+{
+       struct thread *thread = machine__find_thread(machine, tid);
+
+       if (!thread)
+               return -1;
+
+       if (pid)
+               *pid = thread->pid_;

Why is a 'get' function modifying the thread data?

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to