Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1603118pxy; Fri, 23 Apr 2021 12:03:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxs0N6SGwQHQ8HyfKY+dK6HS0YZxvd04bQmLN57TEHEc+i9wU7JIioZngaWBD/jH3BpjLsP X-Received: by 2002:a05:6402:4308:: with SMTP id m8mr6234151edc.209.1619204617997; Fri, 23 Apr 2021 12:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619204617; cv=none; d=google.com; s=arc-20160816; b=cLZ5S2QN246RvwRkzUPZ6lSGIdFlkvcXwaoxRn5zaqkjLpch+BhuNkXE0gQUehJFVA FwQtVRUNIdLMmRmRQ0QS4S6ko39d4lXP8DefDDItjH+Ct0Mh1pcMTzkDPJhy2ivtt3fS 2YSEGzfSFrFsSC7Z8DRCTiQUb9ZvLTW8K0t3L1gtxeRCMnj0qqD9FBWgMLEoRWTBnIQ9 6ZXvYCom04JUX3xTnz+HHShQmWDgHA8s46Pr4EKLR+LV+w1R641kNoN/qsqc+v8YxAqb 9ofv2ZiJoTPTMWX8veofsIWcEC1VJW/Y97s9b/VRgd0rccBcfMG6JM9OvAo1BoBOQi3Y 7NDw== 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=VRmQfXbSTui1UbPF+eZ7iEbur/ixruOY5vQqkgOySLQ=; b=O5fdm09ImSjCrHtdMKa+p1kVlDkVmiFQIyaW88G5M0qiznYAmk2viIGwyWygDeJMaH OKcFkEsLgmfxT5XCt8BkOlJMl7CCLPwmWUlb42jO5J133zup+TgpUrzBRYMHmmuorgsk FjmtWl6cPVjsoEAYKeWJnfsmisFAAFT7bmu10leC9UKFos94Idn5Gu3Vd4BFOjD9ADMY U2Ss+07rNkoMk2NpHNjoCUWOcDE+BUzcpfIYR17dSaDiYrYPjdLCsLwB+FIY5oWq0iSG HT8Ms/Yl5WTU5RgwmmnnwE5Fs/PgHDOUH+U2uZe4tabCRZq/+Wc2bqVMdiDrCbGk/kvQ j49g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZkx44d4; 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 q8si6127608ejy.320.2021.04.23.12.03.14; Fri, 23 Apr 2021 12:03:37 -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=rZkx44d4; 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 S243657AbhDWTCg (ORCPT + 99 others); Fri, 23 Apr 2021 15:02:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:41492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232212AbhDWTCg (ORCPT ); Fri, 23 Apr 2021 15:02:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E14A96023E; Fri, 23 Apr 2021 19:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619204519; bh=epcsoljHvi9gYrkPaYroz7lAJfkykNkXVTsL93os0ks=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rZkx44d41/yEe47pLGE2G3jPry1b03Wq2tvpDSSl0iLEMIISYiYMzu+xf7nPWt1si EQu6ifWgVO8ob/0t9ig92J6sb1++e92ISWpRhB1OjvVaR3jmcUkdqZVdsRHnxOKyVy qSg3fiLucdbVd+/VvirCpJUE+oBVDbMmmGbL0GpQRbY0Lz/T3ug6hiF/qyTfoGG7xW MzBphd0AoycNx1aBQMEUTSJcdnAEZwQZ/Wjyukio+KMw+yBvhrn3HFBK7uLyPuD6XB WrCwjt6lWmqQ5NfiKHjLGAwlxlFEN6ob/jaoJBaGOPL95gKJ6jEe/iyHN+YROZjsJA w3kM664iQpdqg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 45B9340647; Fri, 23 Apr 2021 15:59:55 -0300 (-03) Date: Fri, 23 Apr 2021 15:59:55 -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. Since you pinged on this one, and rightly so, please CC: From the MAINTAINERS file: PERFORMANCE EVENTS SUBSYSTEM R: Jiri Olsa R: Namhyung Kim These reviewers that help me into getting patches processed. Patch is processed now, good catch, I collected Namhyung's Acked-by. Thanks, - Arnaldo > 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 > --- > 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