aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-12-08 05:50:24 -0500
committerIngo Molnar <mingo@kernel.org>2014-12-08 05:50:24 -0500
commit2a2662bf88e693d477ef08351d03934f7bc0b51c (patch)
treecef243df159cc12ada7e97998a253df7c0abb2a2 /tools/perf/util/thread.c
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
parent36748b9518a2437beffe861b47dff6d12b736b3f (diff)
Merge branch 'perf/core-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into perf/hw_breakpoints
Pull AMD range breakpoints support from Frederic Weisbecker: " - Extend breakpoint tools and core to support address range through perf event with initial backend support for AMD extended breakpoints. Syntax is: perf record -e mem:addr/len:type For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512) perf record -e mem:0x1000/512:w - Clean up a bit breakpoint code validation It has been acked by Jiri and Oleg. " Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r--tools/perf/util/thread.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index c41411726c7a..9ebc8b1f9be5 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -4,6 +4,7 @@
4#include <string.h> 4#include <string.h>
5#include "session.h" 5#include "session.h"
6#include "thread.h" 6#include "thread.h"
7#include "thread-stack.h"
7#include "util.h" 8#include "util.h"
8#include "debug.h" 9#include "debug.h"
9#include "comm.h" 10#include "comm.h"
@@ -15,7 +16,7 @@ int thread__init_map_groups(struct thread *thread, struct machine *machine)
15 pid_t pid = thread->pid_; 16 pid_t pid = thread->pid_;
16 17
17 if (pid == thread->tid || pid == -1) { 18 if (pid == thread->tid || pid == -1) {
18 thread->mg = map_groups__new(); 19 thread->mg = map_groups__new(machine);
19 } else { 20 } else {
20 leader = machine__findnew_thread(machine, pid, pid); 21 leader = machine__findnew_thread(machine, pid, pid);
21 if (leader) 22 if (leader)
@@ -66,6 +67,8 @@ void thread__delete(struct thread *thread)
66{ 67{
67 struct comm *comm, *tmp; 68 struct comm *comm, *tmp;
68 69
70 thread_stack__free(thread);
71
69 if (thread->mg) { 72 if (thread->mg) {
70 map_groups__put(thread->mg); 73 map_groups__put(thread->mg);
71 thread->mg = NULL; 74 thread->mg = NULL;
@@ -100,15 +103,14 @@ struct comm *thread__exec_comm(const struct thread *thread)
100 return last; 103 return last;
101} 104}
102 105
103/* CHECKME: time should always be 0 if event aren't ordered */
104int __thread__set_comm(struct thread *thread, const char *str, u64 timestamp, 106int __thread__set_comm(struct thread *thread, const char *str, u64 timestamp,
105 bool exec) 107 bool exec)
106{ 108{
107 struct comm *new, *curr = thread__comm(thread); 109 struct comm *new, *curr = thread__comm(thread);
108 int err; 110 int err;
109 111
110 /* Override latest entry if it had no specific time coverage */ 112 /* Override the default :tid entry */
111 if (!curr->start && !curr->exec) { 113 if (!thread->comm_set) {
112 err = comm__override(curr, str, timestamp, exec); 114 err = comm__override(curr, str, timestamp, exec);
113 if (err) 115 if (err)
114 return err; 116 return err;
@@ -198,7 +200,6 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp)
198} 200}
199 201
200void thread__find_cpumode_addr_location(struct thread *thread, 202void thread__find_cpumode_addr_location(struct thread *thread,
201 struct machine *machine,
202 enum map_type type, u64 addr, 203 enum map_type type, u64 addr,
203 struct addr_location *al) 204 struct addr_location *al)
204{ 205{
@@ -211,8 +212,7 @@ void thread__find_cpumode_addr_location(struct thread *thread,
211 }; 212 };
212 213
213 for (i = 0; i < ARRAY_SIZE(cpumodes); i++) { 214 for (i = 0; i < ARRAY_SIZE(cpumodes); i++) {
214 thread__find_addr_location(thread, machine, cpumodes[i], type, 215 thread__find_addr_location(thread, cpumodes[i], type, addr, al);
215 addr, al);
216 if (al->map) 216 if (al->map)
217 break; 217 break;
218 } 218 }