Commit e5eb08ac authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-5.3-20190709' of...

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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents f632a817 323fd749
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: LGPL-2.1
#ifndef __TOOLS_LINUX_ZALLOC_H
#define __TOOLS_LINUX_ZALLOC_H

#include <stddef.h>

void *zalloc(size_t size);
void __zfree(void **ptr);

#define zfree(ptr) __zfree((void **)(ptr))

#endif // __TOOLS_LINUX_ZALLOC_H

tools/lib/zalloc.c

0 → 100644
+15 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: LGPL-2.1

#include <stdlib.h>
#include <linux/zalloc.h>

void *zalloc(size_t size)
{
	return calloc(1, size);
}

void __zfree(void **ptr)
{
	free(*ptr);
	*ptr = NULL;
}
+1 −0
Original line number Diff line number Diff line
@@ -18,3 +18,4 @@ tools/lib/find_bit.c
tools/lib/bitmap.c
tools/lib/str_error_r.c
tools/lib/vsprintf.c
tools/lib/zalloc.c
+1 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/zalloc.h>
#include <sys/types.h>
#include <regex.h>

+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

#include <stdbool.h>
#include <linux/coresight-pmu.h>
#include <linux/zalloc.h>

#include "../../util/auxtrace.h"
#include "../../util/evlist.h"
Loading