Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4739538pxk; Wed, 30 Sep 2020 10:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyme3f0wxxBnLJirLpNChKCFnApb6KWd9xneDzEztpRO9NMlZoU4FbrZT+0U/wW3E3K/ujJ X-Received: by 2002:a17:906:4b18:: with SMTP id y24mr3797819eju.471.1601486606439; Wed, 30 Sep 2020 10:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601486606; cv=none; d=google.com; s=arc-20160816; b=jI32yMYlafxNnh3eVym24YcTtJ2qhCy6aUeO2pkrZVHgx+7CPLx5SqP2fZDjIdVZfU F2reKlIm0RyVT2i+PuJJ6v0jj7Fyf2++sAvgYg1rcM6pKM7TaQmrKhbmg7cRg05C7THi 0iquFpqziOtvmW6WxAWSuesrezMEPLMitL7uyGlWC02PpIYBzmVoh6kHk5+V9vb7bvy2 3Ryw+4DZCln/h2UHOoN9qsuE1jqOtQHTI5+pEPSyxUVXhfou5LtZDDddmLq4Ky/TF7wK HhaT4hRXjpmjft2nNuoIjh8FCgWjs8ggY+W1I3zrBSRUXZ50zVpTZIRhHFNTe1uT9Ozp G5MA== 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=3SGUA2qe/4fv3NszPsR+Sv3jqq4U41Ism53jMKkiILY=; b=iHLvskDRopu4YWLgqrCkh/FbfPZjhyNKDbt31VxU3y3PnarhwgLD74ouyZdzfdaKP8 WMQPDX5cAIgu9RxZVL334uO0IDikFNoX21xJMGqhzXnRf9l7IGxSI/hVlZfRj5A3puZv j3EMlcNRSJZ3zv6WEZnCldoW7qul1WPa8jiMHcjjerYaY658wZBjlOI23dRMXW+BMIpB pMhEB08Q3rJpaGUm9kUYzisozO/44oLPyPJdy2uMlE7dupSIXoVsSA/pR2MG4Huo2zv6 4qTyDJhVpD0yvsY9SEKsL7S1R00CKDO92CDxj9K6S/p+75Ozz3rQniI5q2bhN0hxpkxX 25hA== 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 u29si1434088eda.15.2020.09.30.10.23.02; Wed, 30 Sep 2020 10:23:26 -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 S1730893AbgI3RWC convert rfc822-to-8bit (ORCPT + 99 others); Wed, 30 Sep 2020 13:22:02 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:60271 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbgI3RWC (ORCPT ); Wed, 30 Sep 2020 13:22:02 -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-549-toMtycdJP2GOtTJAUnDm4w-1; Wed, 30 Sep 2020 13:15:42 -0400 X-MC-Unique: toMtycdJP2GOtTJAUnDm4w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0FC4164082; Wed, 30 Sep 2020 17:15:40 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.194.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8C23702E7; Wed, 30 Sep 2020 17:15:37 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian Subject: [PATCH 9/9] perf tools: Align buildid list output for short build ids Date: Wed, 30 Sep 2020 19:15:12 +0200 Message-Id: <20200930171512.3986425-10-jolsa@kernel.org> In-Reply-To: <20200930171512.3986425-1-jolsa@kernel.org> References: <20200930171512.3986425-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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