diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 34bf89f7f4f36f72f13b645dde1b022ebe7ae7d8..daa55910ff281e014cd808d597e964a1150c05fe 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -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);