Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp153891pxu; Tue, 13 Oct 2020 19:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRt3fdufWFmpL58CgF7J+NsXuSLkATfElgyaa6tRBcn2JRF0JqVtLwqyd5iUXTqNaVZrm4 X-Received: by 2002:aa7:c984:: with SMTP id c4mr2901966edt.42.1602644117109; Tue, 13 Oct 2020 19:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602644117; cv=none; d=google.com; s=arc-20160816; b=mv977flOalNynibjMWQinh7CANPeXFGctNeahmYk3udL/n5Tt9IEl6eml/ahLAxMB4 UrtU8++CD53ZNfOU/IEummyfyKSJSG9QBL21Y9W444F4eRQxOe4UrEQQ96vE1JenD83g 3/EYLWLxTpK8RusDnvz6DvCxJdeq0WEWu+XoUycrsJ3XuFamtrbecADpG/rQ+fU1HfeM x3Yaq2sBc78rf7qTBUqtTrE8HXF48E28BTrQieWB95VPq31B7F29g/Y2A7rX/McAwhOy sHJ2ygaHcDaZuSXw2wuD4ubQsf2fCOZVyw5oj14ZxcQuM3JrUEkigVTv/JHab5n4W/vY JaxQ== 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 :message-id:date:subject:cc:to:from; bh=X55wiJZ2eBPLv0JsSMr9noeCgedkgd+qeeMV1aXk7yU=; b=ofN62sdCZVqdpFo97CuYPHV0iZovONpf3ny5kSXPmUauqTNv3qZPGEx2SzWLbjN2RU vPkpswpSjwJcIzfF2raXCw03X2/j99IQJ0ZwuMDdviTLs2jWkksfq1wRMzfBSO69sL65 4jh7gRNlDVeaBo4DKmrQni3hGgqcXcBPGXQMUR4bXu3zyWKL+0HHvuLey/qJhWKsoEJd dRarZk2UuHJsEZMPKxvPTrOFz62x0azJnkfaOKJ9AUAT5OmZoNnC6qTaJDrDKp4ftVKx 1smKA81ruvu6pfgm4S7z6eJAtZ70/r2RJoSgU5aHSEehTibfrTwy/qHO9JAFVzpK+UYy QM9Q== 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 c16si1210664edy.220.2020.10.13.19.54.51; Tue, 13 Oct 2020 19:55:17 -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 S1732511AbgJMTYx convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Oct 2020 15:24:53 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:33389 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727499AbgJMTYx (ORCPT ); Tue, 13 Oct 2020 15:24:53 -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-9-aS9oaGg8PFeZNB5PuUtv5A-1; Tue, 13 Oct 2020 15:24:48 -0400 X-MC-Unique: aS9oaGg8PFeZNB5PuUtv5A-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 3AE9F18BE161; Tue, 13 Oct 2020 19:24:46 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.193.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 153C05D9CD; Tue, 13 Oct 2020 19:24:42 +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: [PATCHv2 0/9] perf tools: Add support for build id with different sizes Date: Tue, 13 Oct 2020 21:24:32 +0200 Message-Id: <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 hi, currently we support only one storage size (20 bytes) for build ids. That fits for SHA1 build ids, but there can in theory be any size. The gcc linker supports also MD5, which is 16 bytes. Currently the MD5 build id will be stored in .debug cache with additional zeros, like: $ find ~/.debug .../.debug/.build-id/a5/0e350e97c43b4708d09bcd85ebfff700000000 ... .../buildid-ex-md5/a50e350e97c43b4708d09bcd85ebfff700000000 .../buildid-ex-md5/a50e350e97c43b4708d09bcd85ebfff700000000/elf .../buildid-ex-md5/a50e350e97c43b4708d09bcd85ebfff700000000/probes And the same reflected in buildid-list as well: $ perf buildid-list 17f4e448cc746582ea1881528deb549f7fdb3fd5 [kernel.kallsyms] a50e350e97c43b4708d09bcd85ebfff700000000 .../buildid-ex-md5 This will cause problems in future when we will ask debuginfod for binaries/debuginfo based on build id. This patchset is adding 'struct build_id' object, that holds the build id data and size and use it to store build ids and changes all related functions to use it. Also available in: git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git perf/build_id_size v2 changes: - rebased on current perf/core - updated test to build its own binaries [Namhyung] thanks, jirka --- Jiri Olsa (9): perf tools: Use build_id object in dso perf tools: Pass build_id object to filename__read_build_id perf tools: Pass build id object to sysfs__read_build_id perf tools: Pass build_id object to build_id__sprintf perf tools: Pass build_id object to dso__set_build_id perf tools: Pass build_id object to dso__build_id_equal perf tools: Add size to struct perf_record_header_build_id perf tools: Align buildid list output for short build ids perf tools: Add build id shell test tools/lib/perf/include/perf/event.h | 12 +++++++++++- tools/perf/bench/inject-buildid.c | 4 ++-- tools/perf/builtin-buildid-cache.c | 25 ++++++++++++------------ tools/perf/builtin-inject.c | 4 +--- tools/perf/tests/pe-file-parsing.c | 10 +++++----- tools/perf/tests/sdt.c | 6 +++--- tools/perf/tests/shell/buildid.sh | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/annotate.c | 3 +-- tools/perf/util/build-id.c | 48 +++++++++++++++++++++++++++------------------- tools/perf/util/build-id.h | 8 +++++++- tools/perf/util/dso.c | 23 ++++++++++------------ tools/perf/util/dso.h | 7 +++---- tools/perf/util/dsos.c | 9 +++++---- tools/perf/util/header.c | 15 ++++++++++----- tools/perf/util/map.c | 4 +--- tools/perf/util/probe-event.c | 9 ++++++--- tools/perf/util/probe-finder.c | 8 +++++--- tools/perf/util/scripting-engines/trace-event-python.c | 2 +- tools/perf/util/symbol-elf.c | 35 +++++++++++++++++++-------------- tools/perf/util/symbol-minimal.c | 31 +++++++++++++++--------------- tools/perf/util/symbol.c | 15 +++++++-------- tools/perf/util/symbol.h | 5 +++-- tools/perf/util/synthetic-events.c | 2 +- 23 files changed, 260 insertions(+), 126 deletions(-) create mode 100755 tools/perf/tests/shell/buildid.sh