Skip to contentSkip to conversation

perf machine: Stop accessing atomic_t:: counter directly

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message May 20, 2015 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  59a51c1dc9fbb3fb4af928b852d7b35df83edd74
Gitweb:     http://git.kernel.org/tip/59a51c1dc9fbb3fb4af928b852d7b35df83edd74
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Fri, 15 May 2015 15:32:55 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 15 May 2015 15:32:55 -0300

perf machine: Stop accessing atomic_t::counter directly

Use atomic_read(&counter) instead.

Cc Adrian Hunter <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc David Ahern <[email protected]>
Cc Don Zickus <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/util/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/machine.c +1 -1
index 34bf89f..daa5591 100644
@@ -1311,7 +1311,7 @@ static void __machine__remove_thread(struct machine *machine, struct thread *th,
 	if (machine->last_match == th)
 		machine->last_match = NULL;
 
-	BUG_ON(th->refcnt.counter == 0);
+	BUG_ON(atomic_read(&th->refcnt) == 0);
 	if (lock)
 		pthread_rwlock_wrlock(&machine->threads_lock);
 	rb_erase(&th->rb_node, &machine->threads);