From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F6B21E9B06 for ; Tue, 7 Jan 2025 14:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261345; cv=none; b=d5ZOSJOyrU2pGbitckWzCDFz7JXS9KMf3VqX0VDw24LHN2Hc3BUix3yO4e/v4fcQE6bO93GEsvMHk6jERtDZtf1adMHN9lyzrbKLvI7P5o5hSC0Tev3FpZB+iMvnlVkKKIy2+T4koc90fws0BNLMnbkMz40CeD6TrY4WtcPYruU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261345; c=relaxed/simple; bh=EjiYzwCYUsiOGfwWNrpzVHPjRE3x003vhyNLulMyfKU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kMxqLxOQgT3XaFXyez0FhNrgKupoBoFC2B2NLi6eNqMbmEjJeW9hzEFtcQ1UUbuXnd3TcDTcuvdFrRnZqg/A3kEdCWQVHmZK5bmdnCqXcuYKPRj616nmDoCM6fdC128G5Tbhr/xl3+a2fuLE2c7AZz7m5Qqs8k1OYUSvK+ExL6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=T7A4szNC; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="T7A4szNC" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso94468005e9.1 for ; Tue, 07 Jan 2025 06:49:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736261339; x=1736866139; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bxa1pkfDOEIXCCO+s7+UGe3S6KIxpA4ZbmC+QKaQqYA=; b=T7A4szNCAzNuFBAg8ZwrogsD8oKy5X/qi+qGFz+KVp2Qlo8iQixBiK+7jOgf6OYAmC e3HtNW25HEKCnBuhmjINIqgKVf/SbsLZ8/6LiO4uqU2uONIOSMUs7ULbhOjWI8KrCY8r ss1LCbpSjmG6wf3mi7P9CqJPoSxSv/pPhGMjyZO/p+sVf24yXtBwN/QpZyg/2ONkAqrp B6WTU2IxeBbhd45Tt/6eEivG8lQAcd9ru1bJzhkmI2ctuxzh9JJoWD87b1Wkb1d+WnO/ hRQunjFKhgdEuTlALSHjlkihs9h3plGhvl0E5TUzq99/ScNUPm9BgvwzHFZ1xgvqLzdI OsSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736261339; x=1736866139; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bxa1pkfDOEIXCCO+s7+UGe3S6KIxpA4ZbmC+QKaQqYA=; b=f/D8crIxVITQUnpekv7NZMUcb0UkwEtSh1mf6W6wVpi1aAESMqk9+FVsuZLtN2kTT5 nk90xoD9joiu61hH7yj/OQQ+5/cHI044lcprdfNyd22p9jq7RhPll+gJLAC28Tb/Uuy2 lICWEDKQNgT8TJ6NLM69h7QO7Ysu8p4/FrTEI1SSd7hsTYg2lyQGSpExYK2YcrQ/qLFn Lw3WYWGqBKTde2tltSIAZGTi8QSNqUemY5IDLFCw2EfE3APHvvIiV2KMFLs3u1aXlH8E rIHUVLqg1ouuc0y1He9R62we4w4ANc7VxNAzlXhp6KIlWrYGXmdgc2ZTlQnEOfhyp5oo MYnw== X-Forwarded-Encrypted: i=1; AJvYcCVWH6wTA2jqJ4BuNfafbfJ2sMvAMjyjF3nZvE/WbO/IVk0PM+c+Lstib+X9m4u+5OMPW4We/xG5rsfQi0A=@vger.kernel.org X-Gm-Message-State: AOJu0YwklRbD7KZ9xSvfYRrb/lZfqPOsCKnKK1JZpqVzQyrQPbOXoDKR wXZx0TraOp5DGGeicS2NaAohLZN4u6ZDsUz2tSdlhvzdEcMqWPjqUt8NJDX+mJc= X-Gm-Gg: ASbGncuYLd/ch8HD7Rewq3J1KU2uZsygWoj5eGNPK/PznLPCOM7t0jHB+AjIGulnJR3 lF2J6ql06zCqrB00MFodenT3JZXkDOXiZzXD1piiW04miwRy9HXXYtKa/K7tUyASF48oIlvE0KX 2akSMrl7k+hj5i7fdurycftGDrAE3on1cfqQJrLkl650MXp1SVCgpnwkC2J5EMg0pg0W09HYHpz Omqjo8cVghXnIEb3khdyIlbBigMdk/FncUSCQnOMgE3l78hj3ajjG9vmk/lbQlo5b8= X-Google-Smtp-Source: AGHT+IGxTgtGr0awthP0xG6hue3tpPsHrFGlHGB17oood49NCvoIfY8p2CUZU7ckMGhhD9yqkL+3Sw== X-Received: by 2002:a05:600c:1d12:b0:436:1b86:f05 with SMTP id 5b1f17b1804b1-436dc20b0c1mr27910445e9.11.1736261339591; Tue, 07 Jan 2025 06:48:59 -0800 (PST) Received: from [192.168.68.163] ([145.224.66.180]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656b3b2a4sm634498665e9.27.2025.01.07.06.48.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 06:48:59 -0800 (PST) Message-ID: Date: Tue, 7 Jan 2025 14:48:58 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] perf ftrace: Add --graph-opts option to profile subcommand To: Namhyung Kim Cc: Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Ian Rogers , Kan Liang References: <20250103231630.928815-1-namhyung@kernel.org> <20250103231630.928815-2-namhyung@kernel.org> Content-Language: en-US From: James Clark In-Reply-To: <20250103231630.928815-2-namhyung@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/01/2025 11:16 pm, Namhyung Kim wrote: > Like trace subcommand, it should be able to pass some options to control > the tracing behavior for the function graph tracer. But some options > are limited in order to maintain the internal behavior. > > For example, it can limit the function call depth like below: > > # perf ftrace profile --graph-opts depth=5 -- myprog > > Signed-off-by: Namhyung Kim > --- > tools/perf/Documentation/perf-ftrace.txt | 8 ++++++++ > tools/perf/builtin-ftrace.c | 4 ++++ > 2 files changed, 12 insertions(+) > Reviewed-by: James Clark > diff --git a/tools/perf/Documentation/perf-ftrace.txt b/tools/perf/Documentation/perf-ftrace.txt > index 16b067eb5d84746d..4a69a1135f07341b 100644 > --- a/tools/perf/Documentation/perf-ftrace.txt > +++ b/tools/perf/Documentation/perf-ftrace.txt > @@ -205,6 +205,14 @@ OPTIONS for 'perf ftrace profile' > Sort the result by the given field. Available values are: > total, avg, max, count, name. Default is 'total'. > > +--graph-opts:: > + List of options allowed to set: > + > + - nosleep-time - Measure on-CPU time only for function_graph tracer. > + - noirqs - Ignore functions that happen inside interrupt. > + - thresh= - Setup trace duration threshold in microseconds. > + - depth= - Set max depth for function graph tracer to follow. > + > > SEE ALSO > -------- > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c > index 0ac2b20b272bd790..d747cca2403e494e 100644 > --- a/tools/perf/builtin-ftrace.c > +++ b/tools/perf/builtin-ftrace.c > @@ -1072,6 +1072,7 @@ static int prepare_func_profile(struct perf_ftrace *ftrace) > { > ftrace->tracer = "function_graph"; > ftrace->graph_tail = 1; > + ftrace->graph_verbose = 0; > > ftrace->profile_hash = hashmap__new(profile_hash, profile_equal, NULL); > if (ftrace->profile_hash == NULL) > @@ -1660,6 +1661,9 @@ int cmd_ftrace(int argc, const char **argv) > OPT_CALLBACK('s', "sort", &profile_sort, "key", > "Sort result by key: total (default), avg, max, count, name.", > parse_sort_key), > + OPT_CALLBACK(0, "graph-opts", &ftrace, "options", > + "Graph tracer options, available options: nosleep-time,noirqs,thresh=,depth=", > + parse_graph_tracer_opts), > OPT_PARENT(common_options), > }; > const struct option *options = ftrace_options;