Skip to content

Commit e5eb08a

Browse files
committed
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>
2 parents f632a81 + 323fd74 commit e5eb08a

147 files changed

Lines changed: 375 additions & 279 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tools/include/linux/zalloc.h‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-License-Identifier: LGPL-2.1
2+
#ifndef __TOOLS_LINUX_ZALLOC_H
3+
#define __TOOLS_LINUX_ZALLOC_H
4+
5+
#include <stddef.h>
6+
7+
void *zalloc(size_t size);
8+
void __zfree(void **ptr);
9+
10+
#define zfree(ptr) __zfree((void **)(ptr))
11+
12+
#endif // __TOOLS_LINUX_ZALLOC_H

‎tools/lib/zalloc.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: LGPL-2.1
2+
3+
#include <stdlib.h>
4+
#include <linux/zalloc.h>
5+
6+
void *zalloc(size_t size)
7+
{
8+
return calloc(1, size);
9+
}
10+
11+
void __zfree(void **ptr)
12+
{
13+
free(*ptr);
14+
*ptr = NULL;
15+
}

‎tools/perf/MANIFEST‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ tools/lib/find_bit.c
1818
tools/lib/bitmap.c
1919
tools/lib/str_error_r.c
2020
tools/lib/vsprintf.c
21+
tools/lib/zalloc.c

‎tools/perf/arch/arm/annotate/instructions.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/compiler.h>
3+
#include <linux/zalloc.h>
34
#include <sys/types.h>
45
#include <regex.h>
56

‎tools/perf/arch/arm/util/auxtrace.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <stdbool.h>
88
#include <linux/coresight-pmu.h>
9+
#include <linux/zalloc.h>
910

1011
#include "../../util/auxtrace.h"
1112
#include "../../util/evlist.h"

‎tools/perf/arch/arm/util/cs-etm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/kernel.h>
1313
#include <linux/log2.h>
1414
#include <linux/types.h>
15+
#include <linux/zalloc.h>
1516

1617
#include "cs-etm.h"
1718
#include "../../perf.h"

‎tools/perf/arch/arm64/util/arm-spe.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/types.h>
99
#include <linux/bitops.h>
1010
#include <linux/log2.h>
11+
#include <linux/zalloc.h>
1112
#include <time.h>
1213

1314
#include "../../util/cpumap.h"

‎tools/perf/arch/common.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <stdio.h>
3+
#include <stdlib.h>
34
#include "common.h"
45
#include "../util/env.h"
5-
#include "../util/util.h"
66
#include "../util/debug.h"
7+
#include <linux/zalloc.h>
78

89
const char *const arc_triplets[] = {
910
"arc-linux-",

‎tools/perf/arch/powerpc/util/perf_regs.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#include <errno.h>
33
#include <string.h>
44
#include <regex.h>
5+
#include <linux/zalloc.h>
56

67
#include "../../perf.h"
7-
#include "../../util/util.h"
88
#include "../../util/perf_regs.h"
99
#include "../../util/debug.h"
1010

11+
#include <linux/kernel.h>
12+
1113
const struct sample_reg sample_reg_masks[] = {
1214
SMPL_REG(r0, PERF_REG_POWERPC_R0),
1315
SMPL_REG(r1, PERF_REG_POWERPC_R1),

‎tools/perf/arch/s390/util/auxtrace.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/types.h>
44
#include <linux/bitops.h>
55
#include <linux/log2.h>
6+
#include <linux/zalloc.h>
67

78
#include "../../util/evlist.h"
89
#include "../../util/auxtrace.h"

0 commit comments

Comments
 (0)