Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754747AbbGUJgD (ORCPT ); Tue, 21 Jul 2015 05:36:03 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40258 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753195AbbGUJgA (ORCPT ); Tue, 21 Jul 2015 05:36:00 -0400 Date: Tue, 21 Jul 2015 02:35:33 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: a.p.zijlstra@chello.nl, bp@suse.de, namhyung@kernel.org, jolsa@kernel.org, masami.hiramatsu.pt@hitachi.com, paulus@samba.org, adrian.hunter@intel.com, mingo@kernel.org, acme@redhat.com, hpa@zytor.com, hemant@linux.vnet.ibm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: namhyung@kernel.org, bp@suse.de, a.p.zijlstra@chello.nl, mingo@kernel.org, adrian.hunter@intel.com, paulus@samba.org, jolsa@kernel.org, masami.hiramatsu.pt@hitachi.com, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hemant@linux.vnet.ibm.com, hpa@zytor.com In-Reply-To: <20150715091428.8915.75265.stgit@localhost.localdomain> References: <20150715091428.8915.75265.stgit@localhost.localdomain> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf buildid: Use SBUILD_ID_SIZE macro Git-Commit-ID: d77fac7f9e687d137b17296d86d9143c2cccab6a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4739 Lines: 132 Commit-ID: d77fac7f9e687d137b17296d86d9143c2cccab6a Gitweb: http://git.kernel.org/tip/d77fac7f9e687d137b17296d86d9143c2cccab6a Author: Masami Hiramatsu AuthorDate: Wed, 15 Jul 2015 18:14:28 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 20 Jul 2015 17:49:50 -0300 perf buildid: Use SBUILD_ID_SIZE macro Introduce SBUILD_ID_SIZE macro and use it instead of using BUILD_ID_SIZE * 2 + 1. Signed-off-by: Masami Hiramatsu Cc: Adrian Hunter Cc: Borislav Petkov Cc: Hemant Kumar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150715091428.8915.75265.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-buildid-cache.c | 8 ++++---- tools/perf/builtin-buildid-list.c | 4 ++-- tools/perf/util/build-id.c | 4 ++-- tools/perf/util/build-id.h | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index ddca990..65b4835 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c @@ -127,7 +127,7 @@ static int build_id_cache__kcore_existing(const char *from_dir, char *to_dir, static int build_id_cache__add_kcore(const char *filename, bool force) { - char dir[32], sbuildid[BUILD_ID_SIZE * 2 + 1]; + char dir[32], sbuildid[SBUILD_ID_SIZE]; char from_dir[PATH_MAX], to_dir[PATH_MAX]; char *p; @@ -184,7 +184,7 @@ static int build_id_cache__add_kcore(const char *filename, bool force) static int build_id_cache__add_file(const char *filename) { - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + char sbuild_id[SBUILD_ID_SIZE]; u8 build_id[BUILD_ID_SIZE]; int err; @@ -204,7 +204,7 @@ static int build_id_cache__add_file(const char *filename) static int build_id_cache__remove_file(const char *filename) { u8 build_id[BUILD_ID_SIZE]; - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + char sbuild_id[SBUILD_ID_SIZE]; int err; @@ -276,7 +276,7 @@ static int build_id_cache__fprintf_missing(struct perf_session *session, FILE *f static int build_id_cache__update_file(const char *filename) { u8 build_id[BUILD_ID_SIZE]; - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + char sbuild_id[SBUILD_ID_SIZE]; int err = 0; diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c index 9fe93c8..b5ca988 100644 --- a/tools/perf/builtin-buildid-list.c +++ b/tools/perf/builtin-buildid-list.c @@ -20,7 +20,7 @@ static int sysfs__fprintf_build_id(FILE *fp) { u8 kallsyms_build_id[BUILD_ID_SIZE]; - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + char sbuild_id[SBUILD_ID_SIZE]; if (sysfs__read_build_id("/sys/kernel/notes", kallsyms_build_id, sizeof(kallsyms_build_id)) != 0) @@ -35,7 +35,7 @@ static int sysfs__fprintf_build_id(FILE *fp) static int filename__fprintf_build_id(const char *name, FILE *fp) { u8 build_id[BUILD_ID_SIZE]; - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + char sbuild_id[SBUILD_ID_SIZE]; if (filename__read_build_id(name, build_id, sizeof(build_id)) != sizeof(build_id)) diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index f98c2ff..4a2c2f0 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c @@ -124,7 +124,7 @@ static char *build_id__filename(const char *sbuild_id, char *bf, size_t size) char *dso__build_id_filename(const struct dso *dso, char *bf, size_t size) { - char build_id_hex[BUILD_ID_SIZE * 2 + 1]; + char build_id_hex[SBUILD_ID_SIZE]; if (!dso->has_build_id) return NULL; @@ -384,7 +384,7 @@ static int build_id_cache__add_b(const u8 *build_id, size_t build_id_size, const char *name, bool is_kallsyms, bool is_vdso) { - char sbuild_id[BUILD_ID_SIZE * 2 + 1]; + char sbuild_id[SBUILD_ID_SIZE]; build_id__sprintf(build_id, build_id_size, sbuild_id); diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h index 8501122..ce2f493 100644 --- a/tools/perf/util/build-id.h +++ b/tools/perf/util/build-id.h @@ -1,7 +1,8 @@ #ifndef PERF_BUILD_ID_H_ #define PERF_BUILD_ID_H_ 1 -#define BUILD_ID_SIZE 20 +#define BUILD_ID_SIZE 20 +#define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1) #include "tool.h" #include "strlist.h" -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/