Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1371946pxy; Fri, 23 Apr 2021 06:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyapCBzC3ieaS2D5Por8uQN/FGKREnACZ//+OFl6hYodf2j0xxNLMAQfw/GYFG4frrP/s1Z X-Received: by 2002:a05:6402:5111:: with SMTP id m17mr4749408edd.175.1619185327879; Fri, 23 Apr 2021 06:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619185327; cv=none; d=google.com; s=arc-20160816; b=nRNthLDy3sGuaosQg8U4rZ4tR7gELw71aBz3rYgmU/85ZfbPXMLiuZbXeeZA4197ke r1ZZbmc5nyuDAptD+XuQD8m/k9iabQvq1LSQQdiX0qJSE7put+QuZSuSi1/5q4fN0Hkg EVkAECY2mrOINAPqAgk8OPjI9mcQIvEg1CNZQqgdBRVyY4AfnJdnVmh6tLvtVsGmhGJb dQZO8MCWYCPhQtPRM+8N239FNAJUQ2lua5OpMbyk3Wd5aBIdDfdKfdkZ9X8aJ4n0/2U+ C8D9k0zuhVpfoTniOchG30kadmfTVETHC5S3p7mxNguV+uwcdaqcGYArFtU+w/eTBt5m HxaA== 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=SKnwnsp8BISqat7hOUVxh2pYyBolS4hQOfdvAC09cns=; b=yYA4lBTpSqrPfP8vOovKtixIBGCd2hZApXwn2Gdfc0Tcf1G6ldfAtSHxbYfMbI5dNb ETHtTfXvf/3nrW68THQrLmby+ByKehqbBqBd8HLDK410X/m8PfBri9hbuluxEyiM/9YK VdVMvWeepDU0hBte0jb7/2u8/zGi5A1LqCo9qKQlxNFzl0MeyC9iOwg0gcRgDg7//jNt sHffC55EC8PBQZ9KTuFGq4m1QgBjc5oyh34ijeK3/2fi6fJVCFpVGYi/Ow8COPPXiasf kAKjMglckFcuxiRu4UYEXSN9CHZGv50jDjgHcFubu7VJ4UDgOjcpccT4Hq5npbbLqlu8 DOww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b9IApsIp; 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 i5si5258375edc.355.2021.04.23.06.41.43; Fri, 23 Apr 2021 06:42:07 -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=k20201202 header.b=b9IApsIp; 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 S229931AbhDWNlQ (ORCPT + 99 others); Fri, 23 Apr 2021 09:41:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:55002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhDWNlM (ORCPT ); Fri, 23 Apr 2021 09:41:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B76D361352; Fri, 23 Apr 2021 13:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619185236; bh=wO7XEt5yo8xj6mXlT5bhC3QSmJWtxF0ejIkJ/7vvnHE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b9IApsIprIJfDv3jCRT0S7MopYzRdhARsJQJmd1w4sRz0u63G/GBHGyHDIiEQHkr4 J0txO/rYYArxeig1yG6Z1m0pVRmhgkYlpEi1TB1HY+q30+D+vojyd95he57RkLacxd qQtoadS6uvQCAUyAEG0g5+kl8fhzegpkMmf2ypKrAEMbBN3PxL0QLfBfR46iEHAtHJ 3Vdr17tdzTvPQJGa44K40dXAn44Nvd/YCb4rZGhvhemMyt/z0lRSvZbGgz7Kb5OyeH 1FGl9FwY2318dDoQOJabmTVrKGQ7J6wic5STp6fcVKM34Wlxe34jhtYtb6WU9hcClD eWRSCHJ4cfE9Q== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 3D53C40647; Fri, 23 Apr 2021 10:40:32 -0300 (-03) Date: Fri, 23 Apr 2021 10:40:32 -0300 From: Arnaldo Carvalho de Melo To: Thomas Richter Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com, Alexander Schmidt Subject: Re: [PATCH] [PING] perf ftrace: Command fails on s390 Message-ID: References: <20210421120400.2126433-1-tmricht@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421120400.2126433-1-tmricht@linux.ibm.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Apr 21, 2021 at 02:04:00PM +0200, Thomas Richter escreveu: > 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. Thanks, applied. - Arnaldo > 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 > --- > 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 > -- - Arnaldo