Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5041359rwl; Mon, 3 Apr 2023 13:29:05 -0700 (PDT) X-Google-Smtp-Source: AKy350YlH/F1dReM47xgVCTpSBuj7aLetghU9uAIzMT9fwTVXeXdqoLkRBVxO5H+UC36Vhal2zD/ X-Received: by 2002:a17:90b:4c0a:b0:23f:1210:cea4 with SMTP id na10-20020a17090b4c0a00b0023f1210cea4mr189369pjb.18.1680553745094; Mon, 03 Apr 2023 13:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680553745; cv=none; d=google.com; s=arc-20160816; b=D1QFGRwqMu/J3O03iJJVxhZdQXzwCW2gD0hB1tTuYNQ0UawFu6iZtED1J0Jj1o2Yku 7Ve1n6pHxKmKKF4W5BGVws6P4rQPx2X8v4feizflDXQyxdPhme3EGbyblZkdi+cGsgIQ 5ss24oQuEmimP71Xm+/lsCDAh85OTcFfGBnEETHbxo7QFSzSad3lWXDnrqSG4OcEPng3 YYYf8uJSijClXj7msWGJHkJtNRSMWw1rbX2xwmjqiNr9FSRbmsXDXUGeZ20Y7AZOKtVU TWMMfeH+KQLCvUg+zMBx/O+H2bB6xr8phWc8rseWntdZ54xOAW47byFJp+BTat+3rXzM aQvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FX8ga7ITPfBsorfRMDD55sc37mjNJ5OJ19UmvCoDBUM=; b=zifRycIncrEYXNph1+v0jpzCW44bx0Gfui6Nh8y/476kWcCr8zkRSF0rHbDMe9HW6V l3mv1QMF7LaOtzMpx6WA4FJR2z3ujPY3yI5RwCC8GoMJSVyn9RIlW8WJ3xmpm0CkXFis 1cGmtfHDY9osmrutFbzEqLi1XV5HAG12k0l0mNhbRqHKaFKEmheu8Cglz2fdGA2IjjqP DMeD2Me9g5LgKgMIwpNCCDq/xMmG8967YjtVG2JhpmBeOeaBSUSt1kkHEoLzpJun86GS ViFbC0nscQFCsO0myFw0Z5Anl4OrG/PkVBAW4vQg6dF3XAyZGZ0+0Ol3bDcFO2GMJRhx 0NeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W8kTGH71; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q84-20020a632a57000000b00513fde6403bsi1916690pgq.456.2023.04.03.13.28.53; Mon, 03 Apr 2023 13:29:05 -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=@kernel.org header.s=k20201202 header.b=W8kTGH71; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233241AbjDCU0G (ORCPT + 99 others); Mon, 3 Apr 2023 16:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231644AbjDCUZf (ORCPT ); Mon, 3 Apr 2023 16:25:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEE9840CA; Mon, 3 Apr 2023 13:25:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E14E4629D4; Mon, 3 Apr 2023 20:24:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26506C433D2; Mon, 3 Apr 2023 20:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680553473; bh=91QBxRuG+rj/36B4hBwkQ8h+oBWnHyLVhu12FWCCONI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W8kTGH71sFwl+OsC3I+KiR8KOyeDixAklpjrmMugAQY+ZBJgijHwKWMUIYtgr0u+P BNg00hOMiVhMwTmR69saevYaagHb53+pNAjIb9ODIUlXUMi9M3STHcppcMb1g5Lw1k oASkMWJTeiEh5rsXT47CoNhdAEPznp/LpPR2kMjpFxn1zKckghXiXyP3IxGLt0pi9E GnhhL8QqsG/B8eVBLfU3x5JvLADMEUezqw5G7wi408LLXA+xfKPkYI6RysPeRexFit hhNCnHVK25coCZlojbza13BYO9FvF8RyD7LYeMi4xv23AGf2R0WMQBtm1UlPRMmyNy 56AWn0taghhkQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id A4CA34052D; Mon, 3 Apr 2023 17:24:30 -0300 (-03) Date: Mon, 3 Apr 2023 17:24:30 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2 0/4] Support for llvm-addr2line Message-ID: References: <20230403184033.1836023-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230403184033.1836023-1-irogers@google.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS 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 Em Mon, Apr 03, 2023 at 11:40:29AM -0700, Ian Rogers escreveu: > 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. > > v2. Address review comments from Arnaldo and Namhyung, fixing a > realloc error path, argument ordering and a comment. Added to local repo, build testing, will be in tmp.perf-tools-next soon. - Arnaldo > 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 | 45 ++++++++++ > tools/perf/tests/api-io.c | 36 ++++++++ > tools/perf/util/srcline.c | 171 +++++++++++++++++++++++--------------- > 3 files changed, 184 insertions(+), 68 deletions(-) > > -- > 2.40.0.348.gf938b09366-goog > -- - Arnaldo