From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 B30751FDE24 for ; Wed, 8 Jan 2025 15:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736349841; cv=none; b=Rex9ubjqZLiS5dq4Wl70A9zj3XZJMVjswRUki4doDQOJzE3b0wtSSEOjJ+tgNOw7R7Zf40j+bnH12I8pantxXwm4QodizYKGSZjmt227QHlTOWtipa/1HiJvRlPrHL0NVeN9RTfWTrbmzW1dbNFp/ZmQ0LQ7S9VfmF1sGV3RF2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736349841; c=relaxed/simple; bh=XA0EjxryTKXl7N+SAuVE5NW6HlEVaOoS0KX9HQbWrBw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Xaih88ZpU/IPVsDVxECr7GGFUZlGBtvnIkFb81VTWOzo/Ms0wBJhnaE8brwbe3X0PlMg2JTnTbZ96nc+agQuROYQc4s4rlYZLukgn1lnnK9uwF5qucMBjB320Vvon1D9mcCHumM6erW5AovaQa8y3H47JrAo8NQ1fNtKbKGTBjU= 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=tDVIHQ5n; arc=none smtp.client-ip=209.85.128.52 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="tDVIHQ5n" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43635796b48so6732165e9.0 for ; Wed, 08 Jan 2025 07:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736349837; x=1736954637; 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=3X/XYZ5Pi2fHpiOxTrp2fQ2ew24AnjpHXDKowqHn3Zc=; b=tDVIHQ5nUCqOvvLta8cggZ+FHkdKyh7tlIX5ikj9/POIDM5DNfaqBmxkGGKrtFm9// Gn/pvi8pGb+Y6CW931ncoydZam+1cgb70sj9RfwKubBo6OhT175gwmlSwQSaSrQYnCgR yIBVAoZd4VqwGLjBR2kGsndteZFnJBle4WyZJv0PK2Wdc9BbcFYoov9e8Scek8AXBOL4 x9kt9ev/7KQ26l819iyN2//zU/BvvGPnASCPP/MeeLMb+0GAqeEiLkv6cHBQvBXGUQR6 RFw7VeNx7D/uC21SQgdge/3hZWCZ2h/QKM3f9JQcUwm7SX0gQpeEZacx3owp3DXuH1Fw k1cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736349837; x=1736954637; 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=3X/XYZ5Pi2fHpiOxTrp2fQ2ew24AnjpHXDKowqHn3Zc=; b=PwlldwP059jDVc75OXitKk5K7AsrLxLnN7AZd8VP89fijccdid+lnd80Hhi4pxSej6 /2v9vDe7+DRZYl7j4/FQVI00nt5iPKdD4/R1+ZBuIjuESCilwPSqNYfihVwQcryozGly w1lTntCXpPUjfmqXuhYDt3poBHq/gXcTRerMvsVmG7ERluHeheQleU9WzKM4ZNp7XtnT dGUEUfa0ILA/u1sCLxkQx9dbMk8UJJmwUgiCD0O+V3bUatFCyNKO4bOq37sSvPhkgXq1 X9JVZj0PHcNsxtxhMPK2WPvYrXTIq1bWSVeccD1acJBwaToBKnOV6q5rEo/731bL6NA6 Z4TQ== X-Forwarded-Encrypted: i=1; AJvYcCV/JgJtc2I5B29ezjOerNDKR8HPNCQ4wy+t0JlvnZN4o/7CYbNxQou2SOJt+xpFK90FSfflght1RnIBd1k=@vger.kernel.org X-Gm-Message-State: AOJu0YwlhZ3S83R+BgGLcWoiICj4VLAdK444q7GVkdCR3BvQ7a5ROPq7 iPmIUwkFhjRpKgyde3DsIUvcfY3BK7HwmHBc/zUUDte6H3X2+/OsJzhWlHa7nxA= X-Gm-Gg: ASbGncv2rQuNeRCv14YeB/IYx0Uga8hLGxJJBuzCQkFeSOrlTi8nxYI0srjp9gfr5vS tmKEggfmm2+yTm7foGlyPTpw4lAO8CugkhxxK7AhqFCpPPI41r0aW0sawfZM33WAqqPkHhWifT8 5hjkcsE4uvLjtM2ESqCSxImX6ZHL/f7uDCv2yXJg2UrmYGAFTR4++T9Z4k8ENbaZpuLdzci6nDh fOk2Qg/f9f0rhjWjmm+9pqtOXrDRihSmxTkGxpbnx22ueb6s49ayro6Rg0e+/UP2ow= X-Google-Smtp-Source: AGHT+IGDHENjtghc1Za8Ou8nj2p8AxjnEja7Mbb8NKTZwkJkzmvp6cfs8Pf6rR67ZqWrpOAPwG1QBg== X-Received: by 2002:a05:600c:54d0:b0:436:199e:8458 with SMTP id 5b1f17b1804b1-436dc28eef4mr65744625e9.14.1736349836998; Wed, 08 Jan 2025 07:23:56 -0800 (PST) Received: from [192.168.68.163] ([145.224.90.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8288b8sm52718492f8f.11.2025.01.08.07.23.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2025 07:23:56 -0800 (PST) Message-ID: <384d6c4b-d2ce-47f8-9030-6225758b5923@linaro.org> Date: Wed, 8 Jan 2025 15:23:55 +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] perf report: Fix input reload/switch functionality To: Dmitry Vyukov Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, namhyung@kernel.org, irogers@google.com References: <20250108063628.215577-1-dvyukov@google.com> Content-Language: en-US From: James Clark In-Reply-To: <20250108063628.215577-1-dvyukov@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 08/01/2025 6:36 am, Dmitry Vyukov wrote: > Currently the code checks that there is no "ipc" in the sort order > and add an ipc string. This will always error out on the second pass > after input reload/switch, since the sort order already contains "ipc". > Do the ipc check/fixup only on the first pass. > Hi Dmitry, A reproducer with before and after behavior might be helpful for the review. It might be unrelated to your change here, but the input switch thing didn't seem to do anything for me. If I record two files, open the first one, press S and select the second file nothing seems to change. I assumed it would show the other file but nothing changes? $ perf record -- true $ perf record -o 2.data -- ls $ perf report S key load 2.data > Signed-off-by: Dmitry Vyukov > Fixes: ec6ae74fe8f0 ("perf report: Display average IPC and IPC coverage per symbol") > Cc: Namhyung Kim > Cc: Ian Rogers > Cc: linux-perf-users@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > tools/perf/builtin-report.c | 30 ++++++++++++++++-------------- > 1 file changed, 16 insertions(+), 14 deletions(-) > > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c > index 048c91960ba91..42d7dfdf07d9b 100644 > --- a/tools/perf/builtin-report.c > +++ b/tools/perf/builtin-report.c > @@ -1721,22 +1721,24 @@ int cmd_report(int argc, const char **argv) > symbol_conf.annotate_data_sample = true; > } > > - if (sort_order && strstr(sort_order, "ipc")) { > - parse_options_usage(report_usage, options, "s", 1); > - goto error; > - } > - > - if (sort_order && strstr(sort_order, "symbol")) { > - if (sort__mode == SORT_MODE__BRANCH) { > - snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", > - sort_order, "ipc_lbr"); > - report.symbol_ipc = true; > - } else { > - snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", > - sort_order, "ipc_null"); > + if (last_key != K_SWITCH_INPUT_DATA) { > + if (sort_order && strstr(sort_order, "ipc")) { > + parse_options_usage(report_usage, options, "s", 1); > + goto error; > } > > - sort_order = sort_tmp; > + if (sort_order && strstr(sort_order, "symbol")) { > + if (sort__mode == SORT_MODE__BRANCH) { > + snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", > + sort_order, "ipc_lbr"); > + report.symbol_ipc = true; > + } else { > + snprintf(sort_tmp, sizeof(sort_tmp), "%s,%s", > + sort_order, "ipc_null"); > + } > + > + sort_order = sort_tmp; > + } > } > > if ((last_key != K_SWITCH_INPUT_DATA && last_key != K_RELOAD) && > > base-commit: 09a0fa92e5b45e99cf435b2fbf5ebcf889cf8780