Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3543300ybz; Mon, 20 Apr 2020 05:01:53 -0700 (PDT) X-Google-Smtp-Source: APiQypIYc0ksU/RlqGRmo1DZ95tPmgaR6BN0eMeGGZXwL2zZs+eyxdTjGh237EAcUA6FE4cA4ASy X-Received: by 2002:a7b:c642:: with SMTP id q2mr18096244wmk.41.1587384113573; Mon, 20 Apr 2020 05:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587384113; cv=none; d=google.com; s=arc-20160816; b=GeiDbMfx9zXlV1wSGrgdSdvYkiLjk/HRaoiV+8auV17wlCgJjxDkhb+dkchotasOaa Vpi+zvN5U1kqmF0cVtYoKIBnMvo89rz6CxYrbBaHbq4GGHZ20MXuasF6Nob2SJrBFxB/ GkuSGr8r7iMKgYF+mN74/vm9jUhO7GmqqP0VF1phL8KHKc2Uk9XOJGyQAuzqwXvzLhAX PSdxg+52M4Q2EubT1QRRQV8AY01udVj/9gH9OvQUHywYFEMFbMFrdC2jnfpcjWcGxdOa 6j6NpbCPB6wHuLEsOjp9JKPjPNnWtkGj0/wWJDMj9O/ts2I5RdVU3DIzyKxsRTneolIh qdRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=laIBmSe2ch4Bw459AELbHw1a0PYoWKaukGvwmU6GcyY=; b=0RWuFUGGPCZmI9HCb6snzeQ9zdsAlPAccQ6lweltPg7Xdnc+9eFYsZCPGi/6+W/G5n 6ZF/JvZM6qa1qgP0nlR2OVqOHAwOFNI68dCcWJd1c3TcRxI283YleoHXdRXYBIJ5pQUo wfUGzFzkICdHBeOHNe7zkwpWbSvr4ppxoSWX9nWsqIMPcm6g4fYsfOflL9QGlva4KLCN l85lUH5PbniwNFdJnjaTg7sG2zfjRz9F+EAA9nOquNoJCCCIY2Ch+F0G0rrrEoEZ/0ZM n6tSRKOSKTACpkUPjd//WvoWwIu1USc2rgYQbaJDkJX7ZC5KB6mK53ABpDQeY1bdEbl5 sBww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fIcQlCWf; 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 s2si455122eds.485.2020.04.20.05.01.30; Mon, 20 Apr 2020 05:01:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fIcQlCWf; 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 S1727792AbgDTL5U (ORCPT + 99 others); Mon, 20 Apr 2020 07:57:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:41850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726717AbgDTL5T (ORCPT ); Mon, 20 Apr 2020 07:57:19 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9B5F20724; Mon, 20 Apr 2020 11:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587383838; bh=mK/jtIU2H36LkD2SMmTlMnuQ9BkCxfEfsnrcSSvfuVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fIcQlCWfxQ1hRl8AKjtRpI0dbNjFL/cb1Blq+SULWQS9n7CxVpFVnFnFVHUTWd8DC HNF6mDJftEcWaOwq9cBXaAAXJBsZM1FgvjaHhc5+ORaJPCT4QHs3mH3l/W/mB3a9kE yGgPJPoYiR4zUCXSA11cTpzXsrT3I/dkBJxo+ric= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Kan Liang , Andi Kleen , Jiri Olsa , Adrian Hunter , Alexey Budankov , Mathieu Poirier , Michael Ellerman , Pavel Gerasimov , Peter Zijlstra , Ravi Bangoria , Stephane Eranian , Vitaly Slobodskoy , Arnaldo Carvalho de Melo Subject: [PATCH 52/60] perf thread: Add a knob for LBR stitch approach Date: Mon, 20 Apr 2020 08:53:08 -0300 Message-Id: <20200420115316.18781-53-acme@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200420115316.18781-1-acme@kernel.org> References: <20200420115316.18781-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang The LBR stitch approach should be disabled by default. Because - The stitching approach base on LBR call stack technology. The known limitations of LBR call stack technology still apply to the approach, e.g. Exception handing such as setjmp/longjmp will have calls/returns not match. - This approach is not foolproof. There can be cases where it creates incorrect call stacks from incorrect matches. There is no attempt to validate any matches in another way. The 'lbr_stitch_enable' is used to indicate whether enable LBR stitch approach, which is disabled by default. The following patch will introduce a new option for each tools to enable the LBR stitch approach. Signed-off-by: Kan Liang Reviewed-by: Andi Kleen Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexey Budankov Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Namhyung Kim Cc: Pavel Gerasimov Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Stephane Eranian Cc: Vitaly Slobodskoy Link: http://lore.kernel.org/lkml/20200319202517.23423-10-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/thread.c | 1 + tools/perf/util/thread.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 28b719388028..1f080db23615 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c @@ -47,6 +47,7 @@ struct thread *thread__new(pid_t pid, pid_t tid) thread->tid = tid; thread->ppid = -1; thread->cpu = -1; + thread->lbr_stitch_enable = false; INIT_LIST_HEAD(&thread->namespaces_list); INIT_LIST_HEAD(&thread->comm_list); init_rwsem(&thread->namespaces_lock); diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 20b96b5d1f15..95294050cff2 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h @@ -46,6 +46,9 @@ struct thread { struct srccode_state srccode_state; bool filter; int filter_entry_depth; + + /* LBR call stack stitch */ + bool lbr_stitch_enable; }; struct machine; -- 2.21.1