From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 8017233F8BE for ; Wed, 1 Jul 2026 16:52:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782924729; cv=none; b=MspMNZT6MhVCuRed2DMl/AWmYAVF3mTNUjZems3zAepGp6KZ8wmIWezl9/UJnntbRItireCiPAqnszS2FgIYxIDG0nTGXQz/qBOp+lqPvDkJbxJ6RLJVTk/5qZgW1DGK8K/tPRdqxtet3ahQalIiKh5A4aM6frUnF3fVRwtod1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782924729; c=relaxed/simple; bh=4wE909Viv/4QW7gvr0Tz4foEB91LC61Zan4L84BZxgo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XFFypVsIdTp4trdmFB4Z9TPMcSFRAd62e60/balfq6Tfz677fOCimVREaUbjl+b0n0KSik5C0SqP0xi/Q37HK0PD5/QngVsNpp9Hi6BbA4UTuX0cXayiGQjUdadKkCZevLMtpE+Yvu575JgNQjAKon74UBvNcG2s3nifAPFSAig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ipF6drPT; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ipF6drPT" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-493b27c7451so20590835e9.0 for ; Wed, 01 Jul 2026 09:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782924727; x=1783529527; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HaMjr0O6lQYfeKKEbSNHUS6EGtHYKYoYY+zAW6psid0=; b=ipF6drPT8sG+HSaIt5fHWwpe0bddlLxx0LGEuxNSSY9xHbj/ba2JSVZ7J9GQn92xJP /S9dpvW1faKbNan+ZHeJ5wvL5ZaXues775RrQqdohxYw35Ueh1o2UAnylBP4cJpEaz5r 2SyTMAwPLgH7Z44ZYdrxtOU8G+ZmVn7UQfBnJmTGzThjkBMf8XWVmVqUkPp473J7D65B KSiutgDhWu6zaBwHHHdun507FjO/23cTr6fBZSGC+Fu8PyoNyLrivMT9l8an5Xr4l8cV V/kqvXu12F5V6fpvrQFt3z7jN4QTlRvgvKsLLxCoaAJtcK3cQ4hk5LYlkRCGrm4VXeIw k+kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782924727; x=1783529527; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HaMjr0O6lQYfeKKEbSNHUS6EGtHYKYoYY+zAW6psid0=; b=qRU/OiAIfX8nX3VGrK+5cyEWuwsPYdtyerhNDFDeVFUVxvhCCieJoh1Oyk5MZlWIbt rsIoAsu5/9Q6vFinGjcw5bbtnUZD9d06ndrfp7Ro8Wsz/WFMnDg8KnDjIlGU7PgzQ9WF LWwSNnPpw0ups6StOqPOdq2knh2xagMwwfsXngBhhbtYwwcoKqBRhVZeDp27BUvHzbaW bmyCYxlbwXXne1goa9ESF4xmvujR7QxQE6+2I4fG5wVneA218TScvbRXuGetMagRtVdj wafju4fukMVoi1x5TdmoPL+TFnIju9pXmhRMQzd5Br64nZQTQhZfG58kUAIjRjtFZtj6 sRdQ== X-Forwarded-Encrypted: i=1; AHgh+Rq25IM5cbK4HkR8ZslFdasBDOZWLMysKB4VYzO3DzWSQPoRpg+NK5hIWzczLtdhKJE6F7GXmP8I8XQbR0U=@vger.kernel.org X-Gm-Message-State: AOJu0YxqoNcDYcbgPbBPRhtO9rsHoCFJpT33As5WW1XahOfGAXS31iDm hy4cNyq4604f7OrYd7aRaP+ElTXTvXofk3B03fm/qSSutAXmIaoO5uPP X-Gm-Gg: AfdE7clPLVdmn11367GOyJvb1WjKK+aA5KQldgzx0g7/FkwdjobJacDGsGTJKw1y4fP edhRlwbqW5zR1XtIG3RJTAtzw0bY3ZMIhexqAXmQ+7O6LLs9FqHv64u6jXdlhVLwwVRETeoKZr+ V+KpROSrs14w9K7wZaeYganTldP58f62LsrTtpTig9bQi5hsZDoRWrDvvkuS1+WTX/Vg+regCXd HPIpqOO5uuKJ3k8ybJ2A0VOIXNEpyTh2320uJnhqTmlaMG7BCAvZCLj488cwtYd+XAXRxVFfPu/ TiI0OtlCTFQ4/ToycfZbvHDoYrntuIBrhxh0kcfJeMa5OQLJDcYWdeAU3d92Ksm45fSNTASCPqR rdHC1vRA8fFJel/S3YGyrUKR6UUzN/R/SAYO9r3lLBOrBUrmNVzwvOv7Pud7SFcGXTyh5EmYa5G ZUIdEZDbZqvDgD9njT2pktssm2+tfNhbwkwLYwlDIfXfyQDA== X-Received: by 2002:a05:6000:612:b0:470:e26d:88ff with SMTP id ffacd0b85a97d-475de07c9dbmr10512636f8f.4.1782924726767; Wed, 01 Jul 2026 09:52:06 -0700 (PDT) Received: from pumpkin (host-92-21-50-228.as13285.net. [92.21.50.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-477dd94c829sm1144333f8f.24.2026.07.01.09.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 09:52:06 -0700 (PDT) Date: Wed, 1 Jul 2026 17:52:05 +0100 From: David Laight To: Steven Rostedt Cc: Masami Hiramatsu , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Michal =?UTF-8?B?S291dG7DvQ==?= Subject: Re: [PATCH 2/2] tracing: Keep pid and comm[] in the same structure Message-ID: <20260701175205.7d1a8cb6@pumpkin> In-Reply-To: <20260701082340.5b0bd4e7@gandalf.local.home> References: <20260626212356.64150-1-david.laight.linux@gmail.com> <20260626212356.64150-3-david.laight.linux@gmail.com> <20260629164912.4c1c2855@robin> <20260630110156.5314e2e6@pumpkin> <20260630150348.149e318c@gandalf.local.home> <20260701110407.31f7b6ca@pumpkin> <20260701063822.3af87520@gandalf.local.home> <20260701130404.3887c0e5@pumpkin> <20260701082340.5b0bd4e7@gandalf.local.home> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 1 Jul 2026 08:23:40 -0400 Steven Rostedt wrote: > On Wed, 1 Jul 2026 13:04:04 +0100 > David Laight wrote: > > > > > Well, that would break trace-cmd. As reading the raw buffers clears the > > > trace, and trace-cmd reads the saved_cmdlines file *after* it reads the > > > trace, as during the trace it gets populated. > > > > So you'd need to clear it when tracing is enabled after the buffer is cleared. > > Just a matter of getting the timing right. > > Why? Note, saved_cmdlines is for *all* instances. You can have multiple > instances tracing different things and they still all use the one > saved_cmdlines file. It's not tied to any specific buffer. It's a cache. It > gets populated at the next schedule switch after an event occurs. > Mostly thoughts about the size of the cache and the difference between the apparent default size of 128 and the actual size of 6300. I had said that I'd not really looked at when it was used, just what it contained. None of that is relevant to this patch which just changes the data structures a bit. It also means that most updates will only dirty a single cache line. Indeed it is probably worth comparing the comm[] strings and only doing the write it they differ to avoid dirtying the cache line(s). David