From: tip-bot for John Keeping <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, peterz@infradead.org, hpa@zytor.com,
jolsa@kernel.org, alexander.shishkin@linux.intel.com,
linux-kernel@vger.kernel.org, namhyung@kernel.org,
mingo@kernel.org, khlebnikov@yandex-team.ru, john@metanate.com,
acme@redhat.com
Subject: [tip:perf/core] perf map: Use zalloc for map_groups
Date: Fri, 16 Aug 2019 13:59:36 -0700 [thread overview]
Message-ID: <tip-ab6cd0e5276e24403751e0b3b8ed807738a8571f@git.kernel.org> (raw)
In-Reply-To: <20190815100146.28842-1-john@metanate.com>
Commit-ID: ab6cd0e5276e24403751e0b3b8ed807738a8571f
Gitweb: https://git.kernel.org/tip/ab6cd0e5276e24403751e0b3b8ed807738a8571f
Author: John Keeping <john@metanate.com>
AuthorDate: Thu, 15 Aug 2019 11:01:44 +0100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 16 Aug 2019 12:25:23 -0300
perf map: Use zalloc for map_groups
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>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: john keeping <john@metanate.com>
Link: http://lkml.kernel.org/r/20190815100146.28842-1-john@metanate.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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);
prev parent reply other threads:[~2019-08-16 20:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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-bot for John Keeping [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-ab6cd0e5276e24403751e0b3b8ed807738a8571f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=hpa@zytor.com \
--cc=john@metanate.com \
--cc=jolsa@kernel.org \
--cc=khlebnikov@yandex-team.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).