linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf map: use zalloc for map_groups
@ 2019-07-29 17:24 John Keeping
  2019-07-29 17:24 ` [PATCH 2/2] perf unwind: fix libunwind when tid != pid John Keeping
  0 siblings, 1 reply; 12+ messages in thread
From: John Keeping @ 2019-07-29 17:24 UTC (permalink / raw)
  Cc: John Keeping, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel

In the next commit we will add new fields to map_groups and we need
these to be null if no value is assigned.  The simplest way to achieve
this is to request zeroed memory from the allocator.

Signed-off-by: John Keeping <john@metanate.com>
---
 tools/perf/util/map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 668410b1d426..44b556812e4b 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -636,7 +636,7 @@ bool map_groups__empty(struct map_groups *mg)
 
 struct map_groups *map_groups__new(struct machine *machine)
 {
-	struct map_groups *mg = malloc(sizeof(*mg));
+	struct map_groups *mg = zalloc(sizeof(*mg));
 
 	if (mg != NULL)
 		map_groups__init(mg, machine);
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-08-16 21:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 17:24 [PATCH 1/2] perf map: use zalloc for map_groups John Keeping
2019-07-29 17:24 ` [PATCH 2/2] perf unwind: fix libunwind when tid != pid John Keeping
2019-08-02 13:30   ` Jiri Olsa
2019-08-04 11:44     ` John Keeping
2019-08-15 10:01       ` [PATCH v2 1/3] perf map: use zalloc for map_groups John Keeping
2019-08-15 10:01         ` [PATCH v2 2/3] perf unwind: fix libunwind when tid != pid John Keeping
2019-08-15 14:10           ` Jiri Olsa
2019-08-16 15:30             ` Arnaldo Carvalho de Melo
2019-08-16 21:00           ` [tip:perf/core] perf unwind: Fix " tip-bot for John Keeping
2019-08-15 10:01         ` [PATCH v2 3/3] perf unwind: remove unnecessary test John Keeping
2019-08-16 21:01           ` [tip:perf/core] perf unwind: Remove " tip-bot for John Keeping
2019-08-16 20:59         ` [tip:perf/core] perf map: Use zalloc for map_groups tip-bot for John Keeping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).