Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp346833pxu; Wed, 14 Oct 2020 03:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmfCYAymGueW66cGpwugkzLm8PuQIZtYGZ/rynp8KV5YO/1yK1TEPFqblXE/mP5jsQbghI X-Received: by 2002:a17:906:34d1:: with SMTP id h17mr4329629ejb.87.1602669631775; Wed, 14 Oct 2020 03:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602669631; cv=none; d=google.com; s=arc-20160816; b=B6lgJN41AmwL6PaPDctOAM8GsW4e2383W5d3xhjd5nheJB+WkIEr94kqnN7FGIECNe eLFEv9iuD6Lek6FGbjCG5WVFRsaaXcO9cgIFnIgWShAV57D104uMy7UHfgyX5LGr/ovN dzYSbAN+kCdVkwL7OjRbmJD94r8DyyP/uq8AKJBN0XdTe9y/XwSJVzkVcPZaELrVEmeV PtbUQqd6Jwi9MvO7WmH4rFYUJbbtDFcRGh1+CwUohnFTQnMr/rYWkIpQAqoJGWggPRQu +sIj62l0PLvrquzEgAOx4rGuT+AofIKtmGYDOyKk+wmpc5yP3twN5dYXPotLBme3McvH 674A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=aPvOR+jt4isRt70Cp9sB1vx9fDJBU0NxATG24LX8now=; b=zpuSMrUnKWWqijQcoP0QruKeqDgtqBqI2RvZYd5thd7aFeuNpeZ4UFl8bX3zg3x0J4 0IaK2WH1lfmG/mARuXeMbN+Q2Cu5atYjunXcVexPhJBKLbuXRxFwa89Zs0oJFQ35Z7AD eG9+jFRadn+c+FNzGZEpgSvdizlOk+Ybn9ak8gvP95cLTJFfmHg0fb2ZoK3uc2n56b+G cHb64qE8eZXof2fzAASmu/59DHEXKJoxDT3LLlLGglr0j19MFzlUgbZ+2Fh1s2D1TUmH KEyfGMNcpPgbt12wiFeHf9FqcG4Ar7nnmdA3f7u/hEUhzxo1TcIK0jJhg6/aqiticyX8 QdKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv25si1934002ejb.102.2020.10.14.03.00.03; Wed, 14 Oct 2020 03:00:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387828AbgJMTZ3 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Oct 2020 15:25:29 -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