From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A027C43457 for ; Tue, 13 Oct 2020 19:25:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF4D4208D5 for ; Tue, 13 Oct 2020 19:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602617130; bh=UBJRZMDST5Ewy+9R3aS7a933U/wtFfQ6p4/DJLODE/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0VcqCiK3yqVbHX1xcjYQBDKKBIdXJuoXg6C1XkKTzEC+wpQFTH7LQgZuOVzBbdpRC q9MEaHXtwkFzUdCXRptBmU0sR7wNMRGfzJTs25kXaH9WTSUy1Twc2MUVNdEonNpO8L NqBkpzx9xklvxbX1clYcMQB1lv1q2ly4xIbNlTNY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387906AbgJMTZa convert rfc822-to-8bit (ORCPT ); Tue, 13 Oct 2020 15:25:30 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:34723 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387736AbgJMTZZ (ORCPT ); Tue, 13 Oct 2020 15:25:25 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-P1nB2dtHNFexNGJrtIoc5Q-1; Tue, 13 Oct 2020 15:25:18 -0400 X-MC-Unique: P1nB2dtHNFexNGJrtIoc5Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2595118CBC46; Tue, 13 Oct 2020 19:25:17 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.193.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8EC75D9CD; Tue, 13 Oct 2020 19:25:14 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Ian Rogers , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Stephane Eranian Subject: [PATCH 8/9] perf tools: Align buildid list output for short build ids Date: Tue, 13 Oct 2020 21:24:40 +0200 Message-Id: <20201013192441.1299447-9-jolsa@kernel.org> In-Reply-To: <20201013192441.1299447-1-jolsa@kernel.org> References: <20201013192441.1299447-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jolsa@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With shorter md5 build ids we need to align their paths properly with other build ids: $ perf buildid-list 17f4e448cc746582ea1881528deb549f7fdb3fd5 [kernel.kallsyms] a50e350e97c43b4708d09bcd85ebfff7 .../tools/perf/buildid-ex-md5 1805c738c8f3ec0f47b7ea09080c28f34d18a82b /usr/lib64/ld-2.31.so Acked-by: Ian Rogers Signed-off-by: Jiri Olsa --- tools/perf/util/dso.c | 2 +- tools/perf/util/dso.h | 1 - tools/perf/util/dsos.c | 6 ++++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index ca965845b35e..55c11e854fe4 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -1369,7 +1369,7 @@ int dso__kernel_module_get_build_id(struct dso *dso, return 0; } -size_t dso__fprintf_buildid(struct dso *dso, FILE *fp) +static size_t dso__fprintf_buildid(struct dso *dso, FILE *fp) { char sbuild_id[SBUILD_ID_SIZE]; diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h index f926c96bf230..d8cb4f5680a4 100644 --- a/tools/perf/util/dso.h +++ b/tools/perf/util/dso.h @@ -362,7 +362,6 @@ struct dso *machine__findnew_kernel(struct machine *machine, const char *name, void dso__reset_find_symbol_cache(struct dso *dso); -size_t dso__fprintf_buildid(struct dso *dso, FILE *fp); size_t dso__fprintf_symbols_by_name(struct dso *dso, FILE *fp); size_t dso__fprintf(struct dso *dso, FILE *fp); diff --git a/tools/perf/util/dsos.c b/tools/perf/util/dsos.c index 87161e431830..183a81d5b2f9 100644 --- a/tools/perf/util/dsos.c +++ b/tools/perf/util/dsos.c @@ -287,10 +287,12 @@ size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp, size_t ret = 0; list_for_each_entry(pos, head, node) { + char sbuild_id[SBUILD_ID_SIZE]; + if (skip && skip(pos, parm)) continue; - ret += dso__fprintf_buildid(pos, fp); - ret += fprintf(fp, " %s\n", pos->long_name); + build_id__sprintf(&pos->bid, sbuild_id); + ret += fprintf(fp, "%-40s %s\n", sbuild_id, pos->long_name); } return ret; } -- 2.26.2