From nobody Wed Feb 11 11:30:18 2026 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 069DA155C8C for ; Wed, 29 Jan 2025 00:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738110463; cv=none; b=Iblp0DhzF2fps+il6Go48oxxIaZUar7yvDuz5/FzkBdMOB7lLck+W7hxCXRlRQKnyfnaU1D3G+uavnDrm8JxITmgSO43s4UYkhJCQbTDsK6HKWkhpdrpQfkUhUCCURVQrNZzUUWBTKs1tGZfTc/6BSH0/yMYa45kgsFLkJIf6xc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738110463; c=relaxed/simple; bh=JXR8T33WgTBIEDVxRbVK0LNxlccdzx4b2VLjaRPQh0w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=T1Forli9zXag/q1p0a7RGTPg4s1/ahOzLCTn2d6EzQPim85gN8wcrYwIXSv9+jrVY8VEUrz3sk6SuRVA+KFxmjnLO5JPFov/nHQGn7wQ1jsQAxQH76j7ZtU3yVpUDroahIhx6my1GbWGmErSIOBK2nuKmF+89VVUcu04mAPYGqg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ctshao.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=nvRFGquY; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ctshao.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="nvRFGquY" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-2ef80d30df1so11588501a91.1 for ; Tue, 28 Jan 2025 16:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738110460; x=1738715260; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=/kZ7iqAFWEW/1CVmn2pzdj8BRoAIsJA95X92RXs36J8=; b=nvRFGquYQypX/GMKG5jfKGxtDChsO1vDSr9GUI/hHLe7/D0oI9eS1PosoMoJPE1BEP dX6OVnkNdthZoOTx38OqagAzRcrgQ6546uoSjyKRzD3nzI9AE8UpVTKNG/4yn8HNlnqo n0iLhZGVNlaieHPmDkvL3P246sFVHGauFsb9B4W9zz8gJXwKJBMGFM9UFe4QtNZb8eqr Od3wq84AxXsrIBn1xfoO/eI0IyT6RdnvMIYlNW5r/K26ISmq2oDLSLVtqjd8fo5aRYcW Jr9h1MzBAVv0pQ1ilGxkoxyyUUZ2+zJIcoXa/hX1TJHbyZC0lMQvf9KKEdPKOjwvW/QT Iatg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738110460; x=1738715260; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/kZ7iqAFWEW/1CVmn2pzdj8BRoAIsJA95X92RXs36J8=; b=PoBucNoNP4+vgXiWLBXbeoFFP1+dN73KHNaw224Nuz/V2omognUL7GW8MjCG/NOXwf gfzoF89mqw6SuLQPpd61/Q/t70RJZL8DtTUpytbrVsez673mt0kzw2Kxeyz4EvBrH//Z WeoOW828s8sjHRC1yefqneLP3jdzut+oVmL+MYZhRN2yLB20j47GuwmKR6dBtGLLhphn WE1CeGYQvIBze6fgQtjEqUzu1qcf4tjs0hcTGQdrOlOzQicIzJrAYZYMOX0ZEJ+2lB6p BOFPJYEIT2xAJFzPWyOHY2WvTjUxAr28AzNELUOxW4iGUFY7eYpxdHWiQ5Ol6BcJ9zu4 4MGQ== X-Gm-Message-State: AOJu0Yz2PepAznNXimPjdeVLvgk2Y1/sW5+jTF9cYYO8YbgVCzmz5nIC KBC53b7dCX/Xin/mZYRNN6i4Bc2yyGIO58eCjJIgBjJ6evg6hq/u6OjixoTW6dEKP0IBlYpND3I /soDSgPiMF44LnGr3TqeqbzaO1ugt0FmozRFbWOww/tileiQ9BDm9KQBG+lBHP0WKMHHsf1Uyha G9zF1OjwRVTR0qO7coyLbNMuDKibO4w3Y8YsSW5JdM X-Google-Smtp-Source: AGHT+IHuivb002Myaw3lnKxSivwCEVIBuEWsY7r6mdBhKNiyiCBu9zbawayIbipZdTXtPqU4Sr6JtaI2KY0= X-Received: from pjyr14.prod.google.com ([2002:a17:90a:e18e:b0:2e5:5ffc:1c36]) (user=ctshao job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:5190:b0:2ee:d63f:d8f with SMTP id 98e67ed59e1d1-2f83abb91d4mr1576644a91.13.1738110460020; Tue, 28 Jan 2025 16:27:40 -0800 (PST) Date: Tue, 28 Jan 2025 16:15:01 -0800 In-Reply-To: <20250129001905.619859-1-ctshao@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250129001905.619859-1-ctshao@google.com> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog Message-ID: <20250129001905.619859-6-ctshao@google.com> Subject: [PATCH v3 5/5] perf lock: Update documentation for -o option in contention mode From: Chun-Tse Shao To: linux-kernel@vger.kernel.org Cc: Chun-Tse Shao , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, nathan@kernel.org, ndesaulniers@google.com, morbo@google.com, justinstitt@google.com, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, llvm@lists.linux.dev Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch also decouple -o with -t, and shows warning to notify the new behavior for -ov. Signed-off-by: Chun-Tse Shao --- tools/perf/builtin-lock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index d9b0d7472aea..b925be06b0d8 100644 --- a/tools/perf/builtin-lock.c +++ b/tools/perf/builtin-lock.c @@ -1818,7 +1818,7 @@ static void print_contention_result(struct lock_conte= ntion *con) break; } =20 - if (con->owner && con->save_callstack) { + if (con->owner && con->save_callstack && verbose > 0) { struct rb_root root =3D RB_ROOT; =20 if (symbol_conf.field_sep) @@ -1979,6 +1979,11 @@ static int check_lock_contention_options(const struc= t option *options, } } =20 + if (show_lock_owner && !show_thread_stats) { + pr_warning("Now -o try to show owner's callstack instead of pid and comm= .\n"); + pr_warning("Please use -t option too to keep the old behavior.\n"); + } + return 0; } =20 @@ -2570,7 +2575,8 @@ int cmd_lock(int argc, const char **argv) "Filter specific address/symbol of locks", parse_lock_addr), OPT_CALLBACK('S', "callstack-filter", NULL, "NAMES", "Filter specific function in the callstack", parse_call_stack), - OPT_BOOLEAN('o', "lock-owner", &show_lock_owner, "show lock owners instea= d of waiters"), + OPT_BOOLEAN('o', "lock-owner", &show_lock_owner, "show lock owners instea= d of waiters.\n" + "\t\t\tThis option can be combined with -t, which shows owner's per thre= ad lock stats, or -v, which shows owner's stacktrace"), OPT_STRING_NOEMPTY('x', "field-separator", &symbol_conf.field_sep, "separ= ator", "print result in CSV format with custom separator"), OPT_BOOLEAN(0, "lock-cgroup", &show_lock_cgroups, "show lock stats by cgr= oup"), --=20 2.48.1.262.g85cc9f2d1e-goog