diff options
Diffstat (limited to 'tools/perf/util/dso.c')
-rw-r--r-- | tools/perf/util/dso.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index d38b62a700ca..a96a99d2369f 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -1,12 +1,20 @@ #include <asm/bug.h> +#include <linux/kernel.h> #include <sys/time.h> #include <sys/resource.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <errno.h> +#include "compress.h" +#include "path.h" #include "symbol.h" #include "dso.h" #include "machine.h" #include "auxtrace.h" #include "util.h" #include "debug.h" +#include "string2.h" #include "vdso.h" static const char * const debuglink_paths[] = { @@ -1109,7 +1117,7 @@ struct dso *dso__new(const char *name) INIT_LIST_HEAD(&dso->node); INIT_LIST_HEAD(&dso->data.open_entry); pthread_mutex_init(&dso->lock, NULL); - atomic_set(&dso->refcnt, 1); + refcount_set(&dso->refcnt, 1); } return dso; @@ -1147,13 +1155,13 @@ void dso__delete(struct dso *dso) struct dso *dso__get(struct dso *dso) { if (dso) - atomic_inc(&dso->refcnt); + refcount_inc(&dso->refcnt); return dso; } void dso__put(struct dso *dso) { - if (dso && atomic_dec_and_test(&dso->refcnt)) + if (dso && refcount_dec_and_test(&dso->refcnt)) dso__delete(dso); } |