aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/db-export.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2019-07-13 11:12:47 +0200
committerIngo Molnar <mingo@kernel.org>2019-07-13 11:12:47 +0200
commite5eb08ac81d237e19fc68888bbba2cf88891bbe9 (patch)
treef4425e7d47f6724dc834583a1d4eab8b5d9f6344 /tools/perf/util/db-export.c
parentf632a8170a6b667ee4e3f552087588f0fe13c4bb (diff)
parent323fd749821daab0f327ec86d707c4542963cdb0 (diff)
Merge tag 'perf-core-for-mingo-5.3-20190709' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes: Intel PT: Adrian Hunter: - Fix DROP VIEW power_events_view in the postgresql and sqlite export-db python scripts. perf script: Song Liu: - Assume native_arch for pipe mode, fixing a segfault. perf inject: Arnaldo Carvalho de Melo: - The tool->read() call may pass a NULL evsel, handle it. core: Arnaldo Carvalho de Melo: - Move zalloc/zfree.c to tools/lib, further eroding tools/perf/util.[ch] - Use zfree() where applicable instead of open coded equivalent. - Add stdlib.h and some other headers to places where its needed and were getting via util.h, that doesn't need that anymore. - Use list_del_init() more thoroughly. Miscellaneous: Leo Yan: - Fix use after free and potential NULL pointer derefs detected by the smatch tool in various places. Luke Mujica: - Remove a couple unused variables in the parse-events code. Numfor Mbiziwo-Tiapo: - Initialize variable to suppress memory sanitizer warning in the mmap-thread-lookup 'perf test' entry. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/db-export.c')
-rw-r--r--tools/perf/util/db-export.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c
index 2182f552aac6..2394c7506abe 100644
--- a/tools/perf/util/db-export.c
+++ b/tools/perf/util/db-export.c
@@ -5,6 +5,7 @@
*/
#include <errno.h>
+#include <stdlib.h>
#include "evsel.h"
#include "machine.h"
@@ -13,11 +14,11 @@
#include "symbol.h"
#include "map.h"
#include "event.h"
-#include "util.h"
#include "thread-stack.h"
#include "callchain.h"
#include "call-path.h"
#include "db-export.h"
+#include <linux/zalloc.h>
struct deferred_export {
struct list_head node;
@@ -33,7 +34,7 @@ static int db_export__deferred(struct db_export *dbe)
de = list_entry(dbe->deferred.next, struct deferred_export,
node);
err = dbe->export_comm(dbe, de->comm);
- list_del(&de->node);
+ list_del_init(&de->node);
free(de);
if (err)
return err;
@@ -49,7 +50,7 @@ static void db_export__free_deferred(struct db_export *dbe)
while (!list_empty(&dbe->deferred)) {
de = list_entry(dbe->deferred.next, struct deferred_export,
node);
- list_del(&de->node);
+ list_del_init(&de->node);
free(de);
}
}