Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp56541pxy; Wed, 21 Apr 2021 18:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYeYpwrU6h9Mz9yf7dMTEhcNC+v1BSooSUPeAnFtPSIjMuW90G6Ow4TPM5WgdepEkbsbyr X-Received: by 2002:a65:47ca:: with SMTP id f10mr960904pgs.206.1619054558487; Wed, 21 Apr 2021 18:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619054558; cv=none; d=google.com; s=arc-20160816; b=AaLWIb1LubhGC4YVkVNAaMSoT5ueCxCO9SIkUGbWkeAjnDwl5RFL+FG5+Kldb9j0y2 wc6nKt0KwHp/W+o3u/lDYcjY/ljMckyJa52hJQt/spml8J1sQvNB0NLMT8bGKnoKRjlV IKbQ0LYFmUyZP41obKHx5dhRxcaFEQqVWxDHjS2xZ5ABbKTAsYmMuiQ4h7aA5bGwQHiY FxN+8FbJriD3jPVeshMN9cC1uSpHlLXfThnpVCxzgXRx+orKMu99TVpGaP+4u7GKHaWa 5udd86mmGeJGjx5uhU9x+q4OxcT8W1PT8fB3H63SpEd4cHiDlQWjgabEGk853wHosRuH jiGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FaGZMfKcpaY2SI/xlccaXDE8VdSfkM0I1wpRK4kkOfo=; b=nclvTWwS7jlQgGHsaEU9XhQBCST+xrYh6Xo9jEanPRh0S5FYVxryazkZ8ocmQYqJ5E Cp+GtPP2HEpQUnjzAXJ5XYX6Ce2k202mMNYjZGyI2O4SDss9otJ3TUl0GAAVpPkpSW6G 3UN+13gVWfHS5CGKZWnudLKjEGM77Q/PJfhh5/8eyEFjiCbLifn9NwnuxxWl+Zl/Lm9i CcahlhuykIn+yNOYBo994X4xf2og5LV9+Wew53boADn7MUblQikSgYcRscqiTX+dB6M2 JHuGKGWPvaMBLc/tBfIC1YGPMGjNyxXFmaPhygMc+O35bh3iyNhRzcUWP7uLQ0IxKYRX Jg8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mX4k7AcA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m130si1366660pga.119.2021.04.21.18.22.27; Wed, 21 Apr 2021 18:22:38 -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=@gmail.com header.s=20161025 header.b=mX4k7AcA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241214AbhDUTym (ORCPT + 99 others); Wed, 21 Apr 2021 15:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235876AbhDUTyl (ORCPT ); Wed, 21 Apr 2021 15:54:41 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A65ACC06174A; Wed, 21 Apr 2021 12:54:07 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id b38so7951107ljf.5; Wed, 21 Apr 2021 12:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FaGZMfKcpaY2SI/xlccaXDE8VdSfkM0I1wpRK4kkOfo=; b=mX4k7AcAzC9Nzs+tc4eTqCFngYebglnEkS3JoOV5Jja/R1kfi79G/StPFXEMeRWo/q lED8RhMqMBTXmRIY6qUZLe86ASloZZ4f9BqdBocSovV/Y/zR08Nq9eyDYhiH0b098K5i YwDuPwiuqovAzGz+ogEiZYExfaZwOyxunY+8H+ZTeOyQtM/3o6N2Gjjvg4l+dA49ilWA WGabMW+fk5o5wNqiDvYi5qPCjv5nbTqTnygRmIH3y26x4LOr2G0vsHVUEzpb0BaHvjTR WdNHhE8MThYnXnu6+/IYvJYMfMTlrLpAPcOgjjOmHvi4XbSvoCAM6rgsKRCR/ucXzO3d 8YCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FaGZMfKcpaY2SI/xlccaXDE8VdSfkM0I1wpRK4kkOfo=; b=Lo/bt0efiGe5YqG+MDd5WLa7GhNjXpXeKFWsWR/9litXoGyO7M8aKQ092Q1FIDvBv6 fJBvaPDkPHLQWZMnz0aXCKS8E9kkeBI4kvyA0rSoWmaUiv1HqRkGo3LiJLYzh62R07rZ Scc0TeG/1bCRZx9wH2MMFYwUUCZ6I+aSgc8+nksx6YCPdrcz/CRFgb2UDoRjdoRA6wGW mrLd6v25TW1Po4fjFEena7/qyywQts9iv4rEnoZcTBxtfMLkUYJXZCaN+EzO/CuycPu0 EHbL0FRTnlqPxxsiJPztXaqskmKeauhgt5oRDSQQkJarSBBRSIaPBK2AYbCceSJH3Mr4 aOHg== X-Gm-Message-State: AOAM530BxJEXWVYeTFSCOW/KAs3rbuAzbY0/Cp90/IUwBt9D/m2XjbO3 zH56ew5auUYPvy0yjs8lV3ln48FwJqrkS3WAx2o= X-Received: by 2002:a2e:6a05:: with SMTP id f5mr5744845ljc.23.1619034846218; Wed, 21 Apr 2021 12:54:06 -0700 (PDT) MIME-Version: 1.0 References: <20210421120400.2126433-1-tmricht@linux.ibm.com> In-Reply-To: <20210421120400.2126433-1-tmricht@linux.ibm.com> From: Namhyung Kim Date: Thu, 22 Apr 2021 04:53:55 +0900 Message-ID: Subject: Re: [PATCH] [PING] perf ftrace: Command fails on s390 To: Thomas Richter Cc: linux-kernel , linux-perf-users , Arnaldo Carvalho de Melo , svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com, Alexander Schmidt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, Apr 21, 2021 at 10:03 PM Thomas Richter wrote: > > Command 'perf ftrace -v -- ls' fails in s390 (at least 5.12.0rc6). > > The root cause is a missing pointer dereference which causes an > array element address to be used as PID. > > Fix this by extracting the PID. > > Output before: > # ./perf ftrace -v -- ls > function_graph tracer is used > write '-263732416' to tracing/set_ftrace_pid failed: Invalid argument > failed to set ftrace pid > # > > Output after: > ./perf ftrace -v -- ls > function_graph tracer is used > # tracer: function_graph > # > # CPU DURATION FUNCTION CALLS > # | | | | | | | > 4) | rcu_read_lock_sched_held() { > 4) 0.552 us | rcu_lockdep_current_cpu_online(); > 4) 6.124 us | } > > Signed-off-by: Thomas Richter > Reported-by: Alexander Schmidt Acked-by: Namhyung Kim Thanks, Namhyung > --- > tools/perf/builtin-ftrace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index d49448a1060c..87cb11a7a3ee 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -289,7 +289,7 @@ static int set_tracing_pid(struct perf_ftrace *ftrace) > > for (i = 0; i < perf_thread_map__nr(ftrace->evlist->core.threads); i++) { > scnprintf(buf, sizeof(buf), "%d", > - ftrace->evlist->core.threads->map[i]); > + perf_thread_map__pid(ftrace->evlist->core.threads, i)); > if (append_tracing_file("set_ftrace_pid", buf) < 0) > return -1; > } > -- > 2.30.2 >