Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp371124rwl; Thu, 30 Mar 2023 17:51:02 -0700 (PDT) X-Google-Smtp-Source: AKy350Y6o6OudsnCiH/dNEncF+cnV1ko2QEWQ4z0C2qRradT4wPIS4NBmUqXVBpG6zxSBFFx0Yad X-Received: by 2002:a05:6402:268e:b0:502:465:28d4 with SMTP id w14-20020a056402268e00b00502046528d4mr4406604edd.1.1680223862692; Thu, 30 Mar 2023 17:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680223862; cv=none; d=google.com; s=arc-20160816; b=uYlaBuynAiTIAAODpLy8nNkpteBz71DanCr02g3LY92kGYdosi75sxfPKY+Eh0kyV+ XdAwGq72jTQixDmO9V1xMSWs26n78KG+GyS2/Q9wd3+8Otts1CbeLZFTfYWkbVfgyKXI 2UmJmWYt7IcpS+/Yugoyyp5BBF9dJYGzbt3yhbekRHvwCajY0Hqy9vc/Awr5vEXhKaH3 XqWE6hFl9ku5BhRhg9J5AQbzmNRvXQWvceIMdOWJbYknJDTTUsWcj/5HX6orUFfkNl24 ExyoVoilks68y/p6NnkmcOVFpHOTXXTUAq9wed3JheDspp21lnGfi4iYtUAIJooLLoPM utHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:mime-version:message-id:date :dkim-signature; bh=84rSN6Ht+1euIPSdyCBZjcpP/EwF+4yl0XpMXRK6K0o=; b=NSRX0EpABent5p7pWajnmwI8HOpjh48XCdUH/aHXfI1ATEXr7xKrry7yOQCyrIRTTg f4yq4bfu/iSnyVBKlddA7oVXFyu1icBSePtXwtzD8c+6dx2IPAdyyoxiBZJMag9HQqNj 6B1aMJgRTGXvNc/1JUFQdKL4YvLamIGIBdEO3Z5gGSG3ZNMDk7COCweIhW0PgkhhQNpm y6qFKmHm8tr5G32Hfa4YQ8Kfrwtldgo0GkW0zHGnEJqDwK2H+/z3BJlLaU8ZktoIJJ+h wpV1B7K/o/xKF/uTvBNP8xUfaEiGdPMUNgTiYb48pzcLRQvDg/C0sNrOymXZ2XJJqLAh BP4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eO6h9idt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u26-20020aa7d89a000000b004fcf9727d8esi822048edq.253.2023.03.30.17.50.37; Thu, 30 Mar 2023 17:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=eO6h9idt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjCaAtI (ORCPT + 99 others); Thu, 30 Mar 2023 20:49:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjCaAtG (ORCPT ); Thu, 30 Mar 2023 20:49:06 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079E512CCD for ; Thu, 30 Mar 2023 17:49:06 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id z31-20020a25a122000000b00b38d2b9a2e9so20279478ybh.3 for ; Thu, 30 Mar 2023 17:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680223745; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=84rSN6Ht+1euIPSdyCBZjcpP/EwF+4yl0XpMXRK6K0o=; b=eO6h9idthBFhW8xHGMhl0AqUg17HLN8tPAnocKihroIpMCiEdvoP7m53EnwCd6qkil /VdUBw0S0LW3Up3c3CksxNzX9QdrmWn5A/gx2Adl7JL69alaBGvIwktXbBtn+tlZaHev oUy5D1Gaf4NfMEdt82MYjcTfZ3NUHiWVRdTh5GEFUlI9ydHHt274KcVg0NEA89ls4xrd /LrPI9XkMqokZ5VHiOj26fuf1KeoAJ3YQv6EeoCS4ekdkhbO2IpQxbze4xZEdWbLzOnt DzcNk6+gM1UK5vqx9L4VxEdm72G4ESKxu94dtHGldRzIQTchr1HDm9YkgJzK6juTIG2f M51g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680223745; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=84rSN6Ht+1euIPSdyCBZjcpP/EwF+4yl0XpMXRK6K0o=; b=MIbxC9Lrku3pgXZbR/a6k1neKdnm3B+uL1I3ffcb8RiaTsH/zaZoebw1iPCGmsXDvN 31Wmat0XEy/DtKjGcCv6J8Yo6iCkoBvpxl8BsNKkrTMvaV75RxRpax2VTeesMhZYbV3A 6j5Nh6JvsdnlNC7cMB92HGB9nCRXMuM1YkP1Z79gVzShU8LhOA7zdFNnt18tXWFqYw8A MwB7Ugg6kR1HvmvoMO/C3slsM9XNt9XxaxNmCG5I484YMgtcc6BUb26r4WkI6yQOXFPW 8BrExnvMRuixDxqb6glIVSIvJ3QL0SGhMr3A24ts3GRB/zgXVcwOLtea1Yr6z6THcMJr JK9A== X-Gm-Message-State: AAQBX9dijwtXO4PjBE02VTTmP0FJeGYpbhfqPOlaWQFqqSdDvsAccskM W1YZZURoFCBGIskS6/7jE+QBNMPPG3dO X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:11ea:eb75:e48c:2c04]) (user=irogers job=sendgmr) by 2002:a05:6902:154e:b0:b77:d2db:5f8f with SMTP id r14-20020a056902154e00b00b77d2db5f8fmr16389779ybu.12.1680223745258; Thu, 30 Mar 2023 17:49:05 -0700 (PDT) Date: Thu, 30 Mar 2023 17:48:40 -0700 Message-Id: <20230331004844.1592789-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Subject: [PATCH v1 0/4] Support for llvm-addr2line From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The addr2line command is started and then addresses piped to it. In order to determine the end of a addr2lines output a ',' it output with an expectation to get '??\n??:0\n' as a reply. llvm-addr2line differs in that ',' generates a reply of ','. The approach detects and then caches the addr2line style. When records are read the sentinel is detected appropriately. Comparing the output there is a little more inline data on my machine with llvm-addr2line: $ sudo perf record -a -g sleep 1 $ sudo perf report --addr2line=addr2line > a.txt $ sudo perf report --addr2line=llvm-addr2line > b.txt $ wc -l a.txt b.txt 12386 a.txt 12477 b.txt Some other small changes, switching to the api/io code to avoid file streams wrapping the command's stdin/stdout. Ignore SIGPIPE for when addr2line exits and writes fail. Ian Rogers (4): tools api: Add io__getline perf srcline: Simplify addr2line subprocess perf srcline: Support for llvm-addr2line perf srcline: Avoid addr2line SIGPIPEs tools/lib/api/io.h | 40 ++++++++++ tools/perf/tests/api-io.c | 36 +++++++++ tools/perf/util/srcline.c | 162 +++++++++++++++++++++++--------------- 3 files changed, 174 insertions(+), 64 deletions(-) -- 2.40.0.348.gf938b09366-goog