Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3502384imu; Mon, 7 Jan 2019 04:40:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN6lt2Qxv19U9rRX3e6M9E9ENWZARunQ+kJ38yqE1e/7NWFxPw4ZgEhz6SQpojPD+iQ5Vs3g X-Received: by 2002:a63:5455:: with SMTP id e21mr10873033pgm.316.1546864859461; Mon, 07 Jan 2019 04:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546864859; cv=none; d=google.com; s=arc-20160816; b=d9tXAsO2N0mHOO71fwnfY5BNiD+Ikcqrk7mvo9l35LxX2Vmt4cziUeC21v7E/66Yg6 tqMayvcBq+LG3MsalKR2pbdyjSyGfMPaT9mRMc+VEKkb1tRal5wxvUAf26iN38/dYB/x Jy1IK0pE6k7m90WmCwBAQHNb0tvgwdX9Ccmi5nHYiOz8MJHD/dTXOdYekfXrDK+sybWU 9Gt4r9HOQVrITdx3YRij/9X+bMivf68FfcteVLw8OfME+qKl6YiRqpsk7qdMYWPNgIut +g8luGCr5YY+lsTvt1nPLAJhfq/MwsKdfP66bS+wx7EfgBkJihYa+YyxIVPtCx/NMVUg MS0A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tOG0MdLy6kxa4DiSBxnr6MYcoSu+LSWtQ1i8W86qqEw=; b=N2K0sWFIT+OHqTZtRCBjJeGjawnJjZg7LsxO7Pn6VPG39DpHb+OZ2cGVlDXof7LNuO d4UeAaGL04jt4BpcwDQ6LWYacTpnsI1t70GiIew71cLz3r5/a4iZuZR+0WpsCFnGfvt4 5dkOSU/d4KGdH4Z+7tO1zSC70mSVPnVGM/iNt5d29okL9chQRYMllzKZohHBifEKeH3d KKogICvjBU8A7tXcexzOjmfblJUaz4owLNqjRo0jtTFEeU93WVzfBciPgv/XxKTKochp s5uefpjtPxXJQPwRKxqOY0C+koc4SxSwwE/PX1lnpyxcqbwOKT/IGUKTko2OHBo5L2o3 iGGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sl9pcJNp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si61732401pgh.18.2019.01.07.04.40.44; Mon, 07 Jan 2019 04:40:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sl9pcJNp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727888AbfAGMiE (ORCPT + 99 others); Mon, 7 Jan 2019 07:38:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:53078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbfAGMiC (ORCPT ); Mon, 7 Jan 2019 07:38:02 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 5BF5720859; Mon, 7 Jan 2019 12:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546864681; bh=mCQsbCqBISjjzkIhEEncSxu5U3cXUtzckFub+sYWxT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sl9pcJNpES18Y3QLYGWV3+OKOnQBOERadNREt9vtGYwATHqXOhfUXeaJgyCXeH2nH GAb14Dhqi6XhlO4cNVfpdzawZx2/ljeZbw0vGjaiWcLXOffb2uNnK1miW6Hr76GI+7 WnkyjJdV0AfDcuIHO/nOtODpCUUvaNXzhjPCLInQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Adrian Hunter , Andi Kleen , "David S. Miller" , Jiri Olsa , Leo Yan , Mathieu Poirier , Arnaldo Carvalho de Melo Subject: [PATCH 4.20 067/145] perf script: Use fallbacks for branch stacks Date: Mon, 7 Jan 2019 13:31:44 +0100 Message-Id: <20190107104446.050458027@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107104437.308206189@linuxfoundation.org> References: <20190107104437.308206189@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Adrian Hunter commit 692d0e63324d2954a0c63a812a8588e97023a295 upstream. Branch stacks do not necessarily have the same cpumode as the 'ip'. Use the fallback functions in those cases. This patch depends on patch "perf tools: Add fallback functions for cases where cpumode is insufficient". Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: David S. Miller Cc: Jiri Olsa Cc: Leo Yan Cc: Mathieu Poirier Cc: stable@vger.kernel.org # 4.19 Link: http://lkml.kernel.org/r/20181106210712.12098-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/builtin-script.c | 12 ++++++------ tools/perf/util/scripting-engines/trace-event-python.c | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -728,8 +728,8 @@ static int perf_sample__fprintf_brstack( if (PRINT_FIELD(DSO)) { memset(&alf, 0, sizeof(alf)); memset(&alt, 0, sizeof(alt)); - thread__find_map(thread, sample->cpumode, from, &alf); - thread__find_map(thread, sample->cpumode, to, &alt); + thread__find_map_fb(thread, sample->cpumode, from, &alf); + thread__find_map_fb(thread, sample->cpumode, to, &alt); } printed += fprintf(fp, " 0x%"PRIx64, from); @@ -775,8 +775,8 @@ static int perf_sample__fprintf_brstacks from = br->entries[i].from; to = br->entries[i].to; - thread__find_symbol(thread, sample->cpumode, from, &alf); - thread__find_symbol(thread, sample->cpumode, to, &alt); + thread__find_symbol_fb(thread, sample->cpumode, from, &alf); + thread__find_symbol_fb(thread, sample->cpumode, to, &alt); printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp); if (PRINT_FIELD(DSO)) { @@ -820,11 +820,11 @@ static int perf_sample__fprintf_brstacko from = br->entries[i].from; to = br->entries[i].to; - if (thread__find_map(thread, sample->cpumode, from, &alf) && + if (thread__find_map_fb(thread, sample->cpumode, from, &alf) && !alf.map->dso->adjust_symbols) from = map__map_ip(alf.map, from); - if (thread__find_map(thread, sample->cpumode, to, &alt) && + if (thread__find_map_fb(thread, sample->cpumode, to, &alt) && !alt.map->dso->adjust_symbols) to = map__map_ip(alt.map, to); --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -494,14 +494,14 @@ static PyObject *python_process_brstack( pydict_set_item_string_decref(pyelem, "cycles", PyLong_FromUnsignedLongLong(br->entries[i].flags.cycles)); - thread__find_map(thread, sample->cpumode, - br->entries[i].from, &al); + thread__find_map_fb(thread, sample->cpumode, + br->entries[i].from, &al); dsoname = get_dsoname(al.map); pydict_set_item_string_decref(pyelem, "from_dsoname", _PyUnicode_FromString(dsoname)); - thread__find_map(thread, sample->cpumode, - br->entries[i].to, &al); + thread__find_map_fb(thread, sample->cpumode, + br->entries[i].to, &al); dsoname = get_dsoname(al.map); pydict_set_item_string_decref(pyelem, "to_dsoname", _PyUnicode_FromString(dsoname)); @@ -576,14 +576,14 @@ static PyObject *python_process_brstacks if (!pyelem) Py_FatalError("couldn't create Python dictionary"); - thread__find_symbol(thread, sample->cpumode, - br->entries[i].from, &al); + thread__find_symbol_fb(thread, sample->cpumode, + br->entries[i].from, &al); get_symoff(al.sym, &al, true, bf, sizeof(bf)); pydict_set_item_string_decref(pyelem, "from", _PyUnicode_FromString(bf)); - thread__find_symbol(thread, sample->cpumode, - br->entries[i].to, &al); + thread__find_symbol_fb(thread, sample->cpumode, + br->entries[i].to, &al); get_symoff(al.sym, &al, true, bf, sizeof(bf)); pydict_set_item_string_decref(pyelem, "to", _PyUnicode_FromString(bf));