From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42])
	(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 7022D1DE3CB;
	Mon,  8 Sep 2025 02:06:10 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1757297172; cv=none; b=CwcVRgtfPQpCFB1Dc2JqHSJTNqJyG0zwzGnRmfRdYBcJ8tRamZ5x1cbGN5clNOdj9khj1xMOl2SN0RUSwlUolpw7arGAExwmPyB1ewNmFHKKJlX7mSjseMn5Y+uMGxiHY1WT3Mc4C8gjXiQqjh/jAterQesgObhwpA+xKzQYgo8=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1757297172; c=relaxed/simple;
	bh=QJOp4NHIEyzIkCa2KKXGFZjQSIPaljNJbYzgbJPvaOA=;
	h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Le7oZ4tbevmHJd4oqZCHQASmaTrop6do62jTXLcwQ31OyB5z0On689dpkP6HhYwETuodtPJzcdgz0jKbAs1WGl1PtJub5M9ejwPd4j9f1l0Yw3nQROO0m6Y2qllOgCEMv54a7hBYNThLH0aftd9ATQTkQROpd7fXmdmwxhj9kas=
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=CSXYeOI2; arc=none smtp.client-ip=209.85.219.42
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="CSXYeOI2"
Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-70dfa0a9701so46010846d6.2;
        Sun, 07 Sep 2025 19:06:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1757297169; x=1757901969; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=GvypTPf2Nmf1gYAAFO6PSJI6JwBdKCqaPYYToFGfJnU=;
        b=CSXYeOI21YRkMJL2Nbq9bFKKRN449wqMt+j73chVxqHdwRBpANbBrwsaWEDhoPC68r
         N/HajhmvyzwF/J1++xP0Um/ie8MX3q8j7pauPhxGntFIflrggR4B3hvPJ0ejSIj/Xbdh
         KvODIyqjkpkFknuMSmHOcEweonnnxndR9YUSs7Nm+p6XAB6rumV4vt3D0KXHZFG7/J8g
         AbIvBBneUzLF4CsP485kzKac0SKTcV3IAjVu5VfWijhPY7KM94LexWI6Q+78jPutDJA+
         zx7CQ0PgHmtBn7zIAXK1TX4d+H9JKPCQ7CXg0CUYdFlwckIXCj6KNIlPa6cX0eTqswFh
         OpRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1757297169; x=1757901969;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=GvypTPf2Nmf1gYAAFO6PSJI6JwBdKCqaPYYToFGfJnU=;
        b=WC/ngJ6ycooNOcGjHQ48vMBABOVlsiFAssNUhFdmvNhWzz7VsGckIlqy0gZLevXY9A
         +z/es60dqZ8RqGxqSPWpOUueC0c93H3ljcIN3Ae9VEOcq/L3+BPKruDOlhqQ5rBmYOj+
         ssPuDUL4xcA29eVPJcqbaEoSQ2sjo1I1EQpvH98rXQPoERb/UmShDh5A16v5Kl6fXlSN
         sa5gkJ6ecUoLRoRN3YwLwAQWHau8PBtP7jrHItukg1Hot+Y/Q2KPPD2wUZwlK7hAfv7R
         IE63NyQV4+JvtvYsEq96afnlWWj/ZNDyyvLiM9gE37Eq8CKQqAD/qWg6SIIN0oi1A8tj
         0/AQ==
X-Forwarded-Encrypted: i=1; AJvYcCUx/hbiZKmZylmg9MMSgyaz9zwgG/qlZOA3ONvRYXtKbby1xy5RNqlvttIjmglVnukW5o+hdVyNrz6pzIKNUwscgdTf@vger.kernel.org, AJvYcCXCYEzd3u3V9AW6dEvtG4d9IrNFwk/A3+dCa12BnbPtG8egcNWLFlu7rHhvIRwZ0s78ipjPo64af9Z7xx4=@vger.kernel.org
X-Gm-Message-State: AOJu0YwU3/bDdUfJmd1spMzpw2clDOw4VcVRGz3OkUaV4sF7TpzpQ4Iz
	5WLnmoAAxdgXJLl8ZuspXRAJlBkEKS+9nclnff/J/rXQwzGZ/MInMJ4W
X-Gm-Gg: ASbGncuw4/GBqBReiCAKlUOL5gErgOryeWbo4VDYrERhVrKB4+fmND7VTGGun5KKnDL
	syUEmkxHkZw6CbnUXH4YgeaH9Is82xS19xYtEIxo7CfTQhtsbz6zw8SQRy3qgxp2MckRj77u3+j
	WJFcSsUYYUou1WB94SzWIgsgnNTNGic5ExPm0aPwTp/aQ7YWPYbn5Cz31KBvH6NGo+STENPSgJW
	kL6wjIwZkomYVf0mxzhLIb36g2vLQ7CJfxog4lj8FX65HxY4StTS0oxN70BsxL4RFN6wjHKI202
	6906hYZ92oyi2hUihuSFmPeWvm9Wh2zSZRfosJhFo0bmnBaFNTue1OmoH0GJvXMoHv6IXAnRF5J
	59XVrINh12B72MEAcOvGF++4GYyTjp2OKyjxva3YRK1ivbnacwYl+H74DtIVYaekYXXXfO+ZFb8
	GeB8xjiXQ=
X-Google-Smtp-Source: AGHT+IF2vDv/Ts8PcRRIGsz4Znar8p8GM9h8PBCBwYi2ni8W2GqWIceHmXgATvKewaFwMk7XStKkUA==
X-Received: by 2002:a05:6214:2428:b0:70d:f50e:afe5 with SMTP id 6a1803df08f44-73941de2ac2mr81558306d6.47.1757297169328;
        Sun, 07 Sep 2025 19:06:09 -0700 (PDT)
Received: from ideapad.solutionip.com (wsip-184-179-113-83.ri.ri.cox.net. [184.179.113.83])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-72925b87571sm79638846d6.6.2025.09.07.19.06.08
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 07 Sep 2025 19:06:08 -0700 (PDT)
From: Ivan Pravdin <ipravdin.official@gmail.com>
To: rostedt@goodmis.org,
	tglozar@redhat.com,
	linux-trace-kernel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Ivan Pravdin <ipravdin.official@gmail.com>
Subject: [PATCH v3 0/3] rtla: fix cgroup and trace options parsing
Date: Sun,  7 Sep 2025 22:05:56 -0400
Message-ID: <cover.1757034919.git.ipravdin.official@gmail.com>
X-Mailer: git-send-email 2.48.1
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This series fixes 3 issue in rtla timerlat and osnoise parsing.

1. Fix buffer overflow when using --on-threshold option. Currently
   passing `--on-threshold trace` causes rtla timerlat to segfault.
   First patch addresses this issue.

2. Make -C/--cgroup option more user-friendly. Currently rtla timerlat
   and osnoise parses does not allow to specify tracer's threads cgroup
   name as `-C [cgroup]` or `--cgroup [cgroup]`. Second patch fixes this
   by allowing users to specify cgroup in the aforementioned manner.

3. When specifying `-t/--trace` before `-a/--auto`, trace filename is
   override to default <osnoise|timerlat>_trace.txt. For example, when
   running rtla as

       `rtla timerlat top -t custom_file.txt -a 100`

   when the threshold is reached, timerlat_trace.txt file is created
   instead of specified custom_file.txt. Third patch addresses this
   issue.

changes v2 -> v3:
   - Combined common logic into a utility function to parse optional
     argument value
   - Removed change that removed `clear_terminal` 

changes v1 -> v2:
   - Moved removing clear_terminal from `fix -C/--cgroup interface`
     patch to `fix -a overriding -t argument` patch
   - Added clarification why to remove clear_terminal
   - Added `Fixes:` tag to the `fix -C/--cgroup interface` patch

v2: https://lore.kernel.org/all/cover.1755018581.git.ipravdin.official@gmail.com/
v1: https://lore.kernel.org/all/cover.1755014784.git.ipravdin.official@gmail.com/

Ivan Pravdin (3):
  rtla: fix buffer overflow in actions_parse
  rtla: fix -C/--cgroup interface
  rtla: fix -a overriding -t argument

 Documentation/tools/rtla/common_options.rst |  2 +-
 tools/tracing/rtla/src/actions.c            |  2 +-
 tools/tracing/rtla/src/osnoise_hist.c       | 29 +++++++--------------
 tools/tracing/rtla/src/osnoise_top.c        | 29 +++++++--------------
 tools/tracing/rtla/src/timerlat_hist.c      | 29 +++++++--------------
 tools/tracing/rtla/src/timerlat_top.c       | 29 +++++++--------------
 tools/tracing/rtla/src/utils.c              | 26 ++++++++++++++++++
 tools/tracing/rtla/src/utils.h              |  1 +
 8 files changed, 65 insertions(+), 82 deletions(-)

-- 
2.48.1


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42])
	(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 B424B1E130F;
	Mon,  8 Sep 2025 02:06:13 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1757297175; cv=none; b=pxDHgp+2JqEYLo8UH70lmXqdxNIWtTkMfRTyAriNowLivqHKCxoi/4apR9UJr3CKaviaRefdglQUHwjsKQ+CkgMdlEFAV9rWleKlK/HX08jr7tKLlnz+uqLrW0r0DFNPpg7AWlwoD6zUbB3qSL7c56l8M828qkVqNnsjBi8jags=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1757297175; c=relaxed/simple;
	bh=3oGnWRstd/UVHJx79u10eGgbspDyUadPtUVoAviHh8s=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=IlAxNql/aPgls5Gb0FobHfLxlPvZOEoSCn+Ah93dKi4FZ4uD12nsQuPvMp66Zsc6jXMlG3IklnM8hisdirCfWYWmKbQKnBgPCPSJHHx+ii3rZ4U26/dcvnxZhuuUyejWLMGSC61B+J8+nEWxCYbHxOQFNwoSwMKIltE5bdQRcQA=
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=LfVafo1I; arc=none smtp.client-ip=209.85.219.42
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="LfVafo1I"
Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-7240eb21ccaso37789046d6.0;
        Sun, 07 Sep 2025 19:06:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1757297172; x=1757901972; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2x1h6orz8+wGExapeOmhQBGgWXVchLxViuyUEuu+o04=;
        b=LfVafo1IXUyNaV4UzhoVSfOaprDPbNW4bGEMHKTU3ZSZz2fUNn+FJSBYSKroMBJFMc
         oTyFAjUTmBOF7DX0hEd47wAMU+ucjhsBmdhe23yw/Wv8r5VREQ2etVFPMz+UI5s2+hkU
         dDPm+81BuXhVEYdJDUcqOIM1Pp8wtwNIkyh2sEvN/hWW37B5zSkwd0+CBlzTN2EhDpcw
         lwKlvT3LurZQ9JzqzhQdpSLsD7P2UzQ3mEWUOM+Q7sK/zpzFjAXMG5+6EP7r+Olj8kh8
         IW0ZdwD3sVYtYH478ZiJUvdliiTRQczLz0BPUlyyzbA2Cpi7ajoLrrBAh0x9BIenWxMg
         1pSA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1757297172; x=1757901972;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=2x1h6orz8+wGExapeOmhQBGgWXVchLxViuyUEuu+o04=;
        b=P/6gMwqnvfA4NELX/0gq/IaRMY29VNCyzpg3BRkkM9DeRSA8faYdwQZNR++sHJ+NQ8
         Qy5JPATV4kemN6oHMyiCvUyVTuG3TAJH2IwAR9p6IUjQZyQNm3XtubQrkqOCdY2WAM8j
         RetDUWQrpi5bYS1hpBw77o5Wd0zE9RW4+7EXFrWVN1TO8ST+H75lWjB7/I987RbfxhTf
         7o+fDALE+4+bTqRAvqdc5R/v+xthlSXVF4XJ5TJ38xu33DMe7hqVIl5vrziXMV/4MQLo
         yciNyzMWROyZ7NjEYVasjLLB5mMJxSsBUS6rHiIenXqe8uaO/rurWYenBb32PS5blNiA
         FtIA==
X-Forwarded-Encrypted: i=1; AJvYcCW1q9r/t2WWWz4owlIp2FFxeLRfBhZKLTnOQPMQCJjXk/If2yrnYyHJPtrFHzBPWSKzj5li0SbM2N4S85E=@vger.kernel.org, AJvYcCWYeH0qliHCp4y9hwLxAHD0eYCatkRePJwwFfEtld47sSygqX2uMUe9RXK85NjvHoZWTtEYwbBU3dm7dDi97iP6B88k@vger.kernel.org
X-Gm-Message-State: AOJu0YzvIuR5rZowlS0Bc8yQHoLauW/OXKIn+gGsdYZKfYbTNxMxtZ+Z
	nUC2eP5NojA5phNObtegyql4GOVRbdjqO2p53n4Q+Brv5kepYvtUuxEEPYq1zg==
X-Gm-Gg: ASbGncsIBfQFwJxt5FwF/QBFyNE/f2PxJz5BJ8NOdIAaxyrf/94ewqu5PJWaYzM/Ja4
	DSOiK7OtkI0rF3BVtoGuNssX7yskktdoAbYB4VWavoBFlV6RDs+9tJRT/0f07Y3TMQnVXgu1zHX
	A8siR9M8v8FWo2wYgRr+U62EdPauNrKJRtqrRjSCahe0WFvHV3oihFa+DdrTYoHycbok/3eAlmw
	GPlEwClBgCd5OuAqxaxyCBgUwp4P+5fZfIM1sdeccpvzgq7hiihb36WJ0PeqF3ZkZrcbMAaGFO/
	WqwPgMVnDvP5kvRwnbKCX9uidHl9K6PQvvRql0v+SLUTi1kawlntnlE2LDp0pImTquIDw7n7qMz
	x6xdXrMft+dTadgdunuA5H/pxgrVqpfAWHi72O2WIdu0VmkfsNLk+lIcFSEFlbDLwanUEYP0uGJ
	WMH+xQD8EJdi252KuTPw==
X-Google-Smtp-Source: AGHT+IErm/VTBUJedFUg5eywLLVow7XHdGUcgt/7Vw0xyWJ3PDtRd1czg7DEAmfWvOuT7qHnMMHiBQ==
X-Received: by 2002:ad4:4eea:0:b0:70d:f64e:d49e with SMTP id 6a1803df08f44-72bc44eb4bbmr119584496d6.23.1757297172574;
        Sun, 07 Sep 2025 19:06:12 -0700 (PDT)
Received: from ideapad.solutionip.com (wsip-184-179-113-83.ri.ri.cox.net. [184.179.113.83])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-72925b87571sm79638846d6.6.2025.09.07.19.06.11
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 07 Sep 2025 19:06:12 -0700 (PDT)
From: Ivan Pravdin <ipravdin.official@gmail.com>
To: rostedt@goodmis.org,
	tglozar@redhat.com,
	linux-trace-kernel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Ivan Pravdin <ipravdin.official@gmail.com>
Subject: [PATCH v3 1/3] rtla: fix buffer overflow in actions_parse
Date: Sun,  7 Sep 2025 22:05:57 -0400
Message-ID: <164ffc2ec8edacaf1295789dad82a07817b6263d.1757034919.git.ipravdin.official@gmail.com>
X-Mailer: git-send-email 2.48.1
In-Reply-To: <cover.1757034919.git.ipravdin.official@gmail.com>
References: <cover.1757034919.git.ipravdin.official@gmail.com>
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, tests 3 and 13-22 in tests/timerlat.t fail with error:

    *** buffer overflow detected ***: terminated
    timeout: the monitored command dumped core

The result of running `sudo make check` is

    tests/timerlat.t (Wstat: 0 Tests: 22 Failed: 11)
      Failed tests:  3, 13-22
    Files=3, Tests=34, 140 wallclock secs ( 0.07 usr  0.01 sys + 27.63 cusr
    27.96 csys = 55.67 CPU)
    Result: FAIL

Fix buffer overflow in actions_parse to avoid this error. After this
change, the tests results are

    tests/hwnoise.t ... ok
    tests/osnoise.t ... ok
    tests/timerlat.t .. ok
    All tests successful.
    Files=3, Tests=34, 186 wallclock secs ( 0.06 usr  0.01 sys + 41.10 cusr
    44.38 csys = 85.55 CPU)
    Result: PASS

Fixes: 6ea082b171e0 ("rtla/timerlat: Add action on threshold feature")
Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
---
 tools/tracing/rtla/src/actions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tracing/rtla/src/actions.c b/tools/tracing/rtla/src/actions.c
index aaf0808125d7..eab51c0c0ce2 100644
--- a/tools/tracing/rtla/src/actions.c
+++ b/tools/tracing/rtla/src/actions.c
@@ -131,7 +131,7 @@ actions_parse(struct actions *self, const char *trigger)
 {
 	enum action_type type = ACTION_NONE;
 	char *token;
-	char trigger_c[strlen(trigger)];
+	char trigger_c[strlen(trigger) + 1];
 
 	/* For ACTION_SIGNAL */
 	int signal = 0, pid = 0;
-- 
2.48.1


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45])
	(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 B4C181EBFE0;
	Mon,  8 Sep 2025 02:06:16 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1757297178; cv=none; b=RY4JzB1gn11UkM1BEoySMYTbaCCwWW1JkFsKsOEbl+nbGPoz8krCDdW2CPAWyy0uSPxI8PjN2UccCjboqlWSzVcn9d+8VU5o7b36lwKY35urYso0Tbre1c79JTZSLObP9U4RTZzYGKmTRtwJUzj+JR5J46x8XM94/Qx/SJB8mz0=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1757297178; c=relaxed/simple;
	bh=Q6rPj5XExPw5kXt3UBLLesxku9bvm3nVPnH/RDqDIWo=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=iEJYnCwajd1mjig8hzeWgzjMXrsdBQVchuXWhhZXX82QyurEAijcArydhprFq0bcmrqGGZgYj5Y8aGbTyzYDmUU5zQhT9QtI9kUJ5L9UjJhLfL6NCVvtEN+t/+HwEkyt5WuuYWZIXwNGIod87pDCkvqNQCFsLCnvAjLj+hhom00=
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=avmphYNH; arc=none smtp.client-ip=209.85.219.45
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="avmphYNH"
Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-70ba7aa131fso45197496d6.2;
        Sun, 07 Sep 2025 19:06:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1757297175; x=1757901975; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8rH1Q4HIwxLwZ1f0LKqOXACw6UR10UU8sHDYvnNq8p4=;
        b=avmphYNHS0nioZ2ANAHBt9ftptw/aXNnnqmUfIwZws8J0LLFT90p4ilRmDFXH4USP6
         4ahR8EIfIRWjbY0F86T8t5Z2tQ0bhF5aRD8XTxzjHQSs1CzWRLYFegVDC69FoJD/h9Od
         QILKci2ReTS+IhLDbfx2UPwZgd0AfJ4toi83EsBZC86zMZkxZzD5cAwz0+k0a6MrAJ3V
         RpP6uZ/eo0qgdwkiXGnVbccXrsqKUbCnEpjS+v3LP9z5igZeuNRKbBkq8e+e3O7ARvlJ
         s/RDtFlFjjfOiOIOCsjGcN+QKcrtzzs3fDHueoz2k/J5TvUc4jF0yjSy/Fo+G3+7Z7pL
         vbLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1757297175; x=1757901975;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=8rH1Q4HIwxLwZ1f0LKqOXACw6UR10UU8sHDYvnNq8p4=;
        b=Lln9FLkoiLD3U0pZw3XdKyS1Ihf9nzaCHlxJRR6zaT0RTxDTWvtj5YtdgnRmyarpCE
         uADC02sWZz8DbUrc7m8lJFsd9PhEAqte9MwK8zwdH2llOBHgBvvGyoesceaZavF884pE
         ltJA/8xixi59HB7OsQXDs8lU3spNQ5EK3kmQxYM+T6ea3f8PSXKKodDA6PsuLepjYuKn
         eGS8ZJQuEj3O/Ozmw40hAuQVvB9R2heb7wDXeFAyUBmk7aALwnznHLh37E93EnhMPSUt
         Xo4nabap9ZQsCEUS9W7nx+dDCacbeNZQdcMjW9xC2WkAJO9MVndOQA4VuxXOXIlnZMto
         HJzg==
X-Forwarded-Encrypted: i=1; AJvYcCXDHi6i1BE5r4XJrBB+pCOo2mtl5u8SO3aTJQJHrUZtac9AbLVaobcPjnY84iI6vGUlFVh6paPtUvkOo8ePP5Wk3a6d@vger.kernel.org, AJvYcCXiGq9e5Gy0ztQCvNCydZGTbcK0QZUv16kgZqRyevd2sp0ThHD4eBf6XCXDn/bEIeBq66pBlEqZV4w22ec=@vger.kernel.org
X-Gm-Message-State: AOJu0YyeUsEtXR64LfjpAD2eoH1DN+90XX4cmYWEOKPbn1TjSfRu7M/I
	yZsy8RWeACX4Ep/Siewcnzy/DU3gpk4E32ATXfisijONGVYXiPbmBOT7LVbkjw==
X-Gm-Gg: ASbGncu9TvGLoNXpacMYD0qLRiNt21wEzrbCx3yQUGH6eblthtKHejDm16BNtiktc/e
	gajPFiUu3kRqTduFbLH5kJ2qbRWgg4+aeJsOG4a5leVxAxa/E7a9ewrl5FKAQR50VV2wcp/HvcW
	0WW8XgrcQjAAA9XoCTr+mowZfhFxeKmY88uBls/cF064YpzeVi8P78HdpzZ7U7LFxyXBK2KEgi/
	c2PaH/gWVKA4FI4VkuMS6d86iFIoz9IDcV81/1LEu3/rhQmoP8GnMLakZSdhZ7FMNRwQnK4XXSx
	zFeOgLNuopzjGgk7mxLyAsFb4n6FUBOnU/D8GITdJCnErLFW1Db1OsCtpZBBIZJW7wJoLfA2ycj
	19jitEGOAH/bAS1nsU54KgOyAT7bYJceI3g4h6FFc2SXHN/d6furQ0boO0xB6bEY9/Gmgj/o5Uv
	lW3CA6xdy0Za7ELO8TiA==
X-Google-Smtp-Source: AGHT+IGeUCO95fGBwGUmOSpGDkKozomxcyG5csobsYZCX/t73uJphgb5U1soQgy7YZdwgSNrpRBkyg==
X-Received: by 2002:ad4:5ecb:0:b0:728:7d77:63ba with SMTP id 6a1803df08f44-739371a7998mr69427196d6.33.1757297175254;
        Sun, 07 Sep 2025 19:06:15 -0700 (PDT)
Received: from ideapad.solutionip.com (wsip-184-179-113-83.ri.ri.cox.net. [184.179.113.83])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-72925b87571sm79638846d6.6.2025.09.07.19.06.14
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 07 Sep 2025 19:06:14 -0700 (PDT)
From: Ivan Pravdin <ipravdin.official@gmail.com>
To: rostedt@goodmis.org,
	tglozar@redhat.com,
	linux-trace-kernel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Ivan Pravdin <ipravdin.official@gmail.com>
Subject: [PATCH v3 2/3] rtla: fix -C/--cgroup interface
Date: Sun,  7 Sep 2025 22:05:58 -0400
Message-ID: <a093065d78b7a4377c084fb4dc56942aedc5f6f2.1757034919.git.ipravdin.official@gmail.com>
X-Mailer: git-send-email 2.48.1
In-Reply-To: <cover.1757034919.git.ipravdin.official@gmail.com>
References: <cover.1757034919.git.ipravdin.official@gmail.com>
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently, user can only specify cgroup to the tracer's thread the
following ways:

    `-C[cgroup]`
    `-C[=cgroup]`
    `--cgroup[=cgroup]`

If user tries to specify cgroup as `-C [cgroup]` or `--cgroup [cgroup]`,
the parser silently fails and rtla's cgroup is used for the tracer
threads.

To make interface more user-friendly, allow user to specify cgroup in
the aforementioned way, i.e. `-C [cgroup]` and `--cgroup [cgroup]`.

Refactor identical logic between -t/--trace and -C/--cgroup into a
common function.

Change documentation to reflect this user interface change.

Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
---
 Documentation/tools/rtla/common_options.rst |  2 +-
 tools/tracing/rtla/src/osnoise_hist.c       | 26 ++++++---------------
 tools/tracing/rtla/src/osnoise_top.c        | 26 ++++++---------------
 tools/tracing/rtla/src/timerlat_hist.c      | 26 ++++++---------------
 tools/tracing/rtla/src/timerlat_top.c       | 26 ++++++---------------
 tools/tracing/rtla/src/utils.c              | 26 +++++++++++++++++++++
 tools/tracing/rtla/src/utils.h              |  1 +
 7 files changed, 56 insertions(+), 77 deletions(-)

diff --git a/Documentation/tools/rtla/common_options.rst b/Documentation/tools/rtla/common_options.rst
index 2dc1575210aa..3f292a12b7af 100644
--- a/Documentation/tools/rtla/common_options.rst
+++ b/Documentation/tools/rtla/common_options.rst
@@ -42,7 +42,7 @@
         - *f:prio* - use SCHED_FIFO with *prio*;
         - *d:runtime[us|ms|s]:period[us|ms|s]* - use SCHED_DEADLINE with *runtime* and *period* in nanoseconds.
 
-**-C**, **--cgroup**\[*=cgroup*]
+**-C**, **--cgroup** \[*cgroup*]
 
         Set a *cgroup* to the tracer's threads. If the **-C** option is passed without arguments, the tracer's thread will inherit **rtla**'s *cgroup*. Otherwise, the threads will be placed on the *cgroup* passed to the option.
 
diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index 8d579bcee709..1dc39de79d78 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -422,9 +422,9 @@ static void osnoise_hist_usage(char *usage)
 	static const char * const msg[] = {
 		"",
 		"  usage: rtla osnoise hist [-h] [-D] [-d s] [-a us] [-p us] [-r us] [-s us] [-S us] \\",
-		"	  [-T us] [-t[file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] \\",
+		"	  [-T us] [-t [file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] \\",
 		"	  [-c cpu-list] [-H cpu-list] [-P priority] [-b N] [-E N] [--no-header] [--no-summary] \\",
-		"	  [--no-index] [--with-zeros] [-C[=cgroup_name]] [--warm-up]",
+		"	  [--no-index] [--with-zeros] [-C [cgroup_name]] [--warm-up]",
 		"",
 		"	  -h/--help: print this menu",
 		"	  -a/--auto: set automatic trace mode, stopping the session if argument in us sample is hit",
@@ -435,10 +435,10 @@ static void osnoise_hist_usage(char *usage)
 		"	  -T/--threshold us: the minimum delta to be considered a noise",
 		"	  -c/--cpus cpu-list: list of cpus to run osnoise threads",
 		"	  -H/--house-keeping cpus: run rtla control threads only on the given cpus",
-		"	  -C/--cgroup[=cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
+		"	  -C/--cgroup [cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
 		"	  -d/--duration time[s|m|h|d]: duration of the session",
 		"	  -D/--debug: print debug info",
-		"	  -t/--trace[file]: save the stopped trace to [file|osnoise_trace.txt]",
+		"	  -t/--trace [file]: save the stopped trace to [file|osnoise_trace.txt]",
 		"	  -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed",
 		"	     --filter <filter>: enable a trace event filter to the previous -e event",
 		"	     --trigger <trigger>: enable a trace event trigger to the previous -e event",
@@ -559,13 +559,7 @@ static struct osnoise_params
 			break;
 		case 'C':
 			params->cgroup = 1;
-			if (!optarg) {
-				/* will inherit this cgroup */
-				params->cgroup_name = NULL;
-			} else if (*optarg == '=') {
-				/* skip the = */
-				params->cgroup_name = ++optarg;
-			}
+			params->cgroup_name = parse_optional_arg(argc, argv);
 			break;
 		case 'D':
 			config_debug = 1;
@@ -630,14 +624,8 @@ static struct osnoise_params
 			params->threshold = get_llong_from_str(optarg);
 			break;
 		case 't':
-			if (optarg) {
-				if (optarg[0] == '=')
-					params->trace_output = &optarg[1];
-				else
-					params->trace_output = &optarg[0];
-			} else if (optind < argc && argv[optind][0] != '0')
-				params->trace_output = argv[optind];
-			else
+			params->trace_output = parse_optional_arg(argc, argv);
+			if (!params->trace_output)
 				params->trace_output = "osnoise_trace.txt";
 			break;
 		case '0': /* no header */
diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c
index 2c12780c8aa9..b3e161536ed8 100644
--- a/tools/tracing/rtla/src/osnoise_top.c
+++ b/tools/tracing/rtla/src/osnoise_top.c
@@ -257,8 +257,8 @@ static void osnoise_top_usage(struct osnoise_params *params, char *usage)
 
 	static const char * const msg[] = {
 		" [-h] [-q] [-D] [-d s] [-a us] [-p us] [-r us] [-s us] [-S us] \\",
-		"	  [-T us] [-t[file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] \\",
-		"	  [-c cpu-list] [-H cpu-list] [-P priority] [-C[=cgroup_name]] [--warm-up s]",
+		"	  [-T us] [-t [file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] \\",
+		"	  [-c cpu-list] [-H cpu-list] [-P priority] [-C [cgroup_name]] [--warm-up s]",
 		"",
 		"	  -h/--help: print this menu",
 		"	  -a/--auto: set automatic trace mode, stopping the session if argument in us sample is hit",
@@ -269,10 +269,10 @@ static void osnoise_top_usage(struct osnoise_params *params, char *usage)
 		"	  -T/--threshold us: the minimum delta to be considered a noise",
 		"	  -c/--cpus cpu-list: list of cpus to run osnoise threads",
 		"	  -H/--house-keeping cpus: run rtla control threads only on the given cpus",
-		"	  -C/--cgroup[=cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
+		"	  -C/--cgroup [cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
 		"	  -d/--duration time[s|m|h|d]: duration of the session",
 		"	  -D/--debug: print debug info",
-		"	  -t/--trace[file]: save the stopped trace to [file|osnoise_trace.txt]",
+		"	  -t/--trace [file]: save the stopped trace to [file|osnoise_trace.txt]",
 		"	  -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed",
 		"	     --filter <filter>: enable a trace event filter to the previous -e event",
 		"	     --trigger <trigger>: enable a trace event trigger to the previous -e event",
@@ -394,13 +394,7 @@ struct osnoise_params *osnoise_top_parse_args(int argc, char **argv)
 			break;
 		case 'C':
 			params->cgroup = 1;
-			if (!optarg) {
-				/* will inherit this cgroup */
-				params->cgroup_name = NULL;
-			} else if (*optarg == '=') {
-				/* skip the = */
-				params->cgroup_name = ++optarg;
-			}
+			params->cgroup_name = parse_optional_arg(argc, argv);
 			break;
 		case 'D':
 			config_debug = 1;
@@ -460,14 +454,8 @@ struct osnoise_params *osnoise_top_parse_args(int argc, char **argv)
 			params->stop_total_us = get_llong_from_str(optarg);
 			break;
 		case 't':
-			if (optarg) {
-				if (optarg[0] == '=')
-					params->trace_output = &optarg[1];
-				else
-					params->trace_output = &optarg[0];
-			} else if (optind < argc && argv[optind][0] != '-')
-				params->trace_output = argv[optind];
-			else
+			params->trace_output = parse_optional_arg(argc, argv);
+			if (!params->trace_output)
 				params->trace_output = "osnoise_trace.txt";
 			break;
 		case 'T':
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index 9baea1b251ed..ad713dafa3c3 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -713,9 +713,9 @@ static void timerlat_hist_usage(char *usage)
 	char *msg[] = {
 		"",
 		"  usage: [rtla] timerlat hist [-h] [-q] [-d s] [-D] [-n] [-a us] [-p us] [-i us] [-T us] [-s us] \\",
-		"         [-t[file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] [-c cpu-list] [-H cpu-list]\\",
+		"         [-t [file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] [-c cpu-list] [-H cpu-list]\\",
 		"	  [-P priority] [-E N] [-b N] [--no-irq] [--no-thread] [--no-header] [--no-summary] \\",
-		"	  [--no-index] [--with-zeros] [--dma-latency us] [-C[=cgroup_name]] [--no-aa] [--dump-task] [-u|-k]",
+		"	  [--no-index] [--with-zeros] [--dma-latency us] [-C [cgroup_name]] [--no-aa] [--dump-task] [-u|-k]",
 		"	  [--warm-up s] [--deepest-idle-state n]",
 		"",
 		"	  -h/--help: print this menu",
@@ -726,11 +726,11 @@ static void timerlat_hist_usage(char *usage)
 		"	  -s/--stack us: save the stack trace at the IRQ if a thread latency is higher than the argument in us",
 		"	  -c/--cpus cpus: run the tracer only on the given cpus",
 		"	  -H/--house-keeping cpus: run rtla control threads only on the given cpus",
-		"	  -C/--cgroup[=cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
+		"	  -C/--cgroup [cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
 		"	  -d/--duration time[m|h|d]: duration of the session in seconds",
 		"	     --dump-tasks: prints the task running on all CPUs if stop conditions are met (depends on !--no-aa)",
 		"	  -D/--debug: print debug info",
-		"	  -t/--trace[file]: save the stopped trace to [file|timerlat_trace.txt]",
+		"	  -t/--trace [file]: save the stopped trace to [file|timerlat_trace.txt]",
 		"	  -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed",
 		"	     --filter <filter>: enable a trace event filter to the previous -e event",
 		"	     --trigger <trigger>: enable a trace event trigger to the previous -e event",
@@ -885,13 +885,7 @@ static struct timerlat_params
 			break;
 		case 'C':
 			params->cgroup = 1;
-			if (!optarg) {
-				/* will inherit this cgroup */
-				params->cgroup_name = NULL;
-			} else if (*optarg == '=') {
-				/* skip the = */
-				params->cgroup_name = ++optarg;
-			}
+			params->cgroup_name = parse_optional_arg(argc, argv);
 			break;
 		case 'b':
 			params->bucket_size = get_llong_from_str(optarg);
@@ -962,14 +956,8 @@ static struct timerlat_params
 			params->stop_total_us = get_llong_from_str(optarg);
 			break;
 		case 't':
-			if (optarg) {
-				if (optarg[0] == '=')
-					trace_output = &optarg[1];
-				else
-					trace_output = &optarg[0];
-			} else if (optind < argc && argv[optind][0] != '-')
-				trace_output = argv[optind];
-			else
+			trace_output = parse_optional_arg(argc, argv);
+			if (!trace_output)
 				trace_output = "timerlat_trace.txt";
 			break;
 		case 'u':
diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c
index c80b81c0b4da..7f1885018624 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -480,8 +480,8 @@ static void timerlat_top_usage(char *usage)
 	static const char *const msg[] = {
 		"",
 		"  usage: rtla timerlat [top] [-h] [-q] [-a us] [-d s] [-D] [-n] [-p us] [-i us] [-T us] [-s us] \\",
-		"	  [[-t[file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] [-c cpu-list] [-H cpu-list]\\",
-		"	  [-P priority] [--dma-latency us] [--aa-only us] [-C[=cgroup_name]] [-u|-k] [--warm-up s] [--deepest-idle-state n]",
+		"	  [[-t [file]] [-e sys[:event]] [--filter <filter>] [--trigger <trigger>] [-c cpu-list] [-H cpu-list]\\",
+		"	  [-P priority] [--dma-latency us] [--aa-only us] [-C [cgroup_name]] [-u|-k] [--warm-up s] [--deepest-idle-state n]",
 		"",
 		"	  -h/--help: print this menu",
 		"	  -a/--auto: set automatic trace mode, stopping the session if argument in us latency is hit",
@@ -492,11 +492,11 @@ static void timerlat_top_usage(char *usage)
 		"	  -s/--stack us: save the stack trace at the IRQ if a thread latency is higher than the argument in us",
 		"	  -c/--cpus cpus: run the tracer only on the given cpus",
 		"	  -H/--house-keeping cpus: run rtla control threads only on the given cpus",
-		"	  -C/--cgroup[=cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
+		"	  -C/--cgroup [cgroup_name]: set cgroup, if no cgroup_name is passed, the rtla's cgroup will be inherited",
 		"	  -d/--duration time[s|m|h|d]: duration of the session",
 		"	  -D/--debug: print debug info",
 		"	     --dump-tasks: prints the task running on all CPUs if stop conditions are met (depends on !--no-aa)",
-		"	  -t/--trace[file]: save the stopped trace to [file|timerlat_trace.txt]",
+		"	  -t/--trace [file]: save the stopped trace to [file|timerlat_trace.txt]",
 		"	  -e/--event <sys:event>: enable the <sys:event> in the trace instance, multiple -e are allowed",
 		"	     --filter <command>: enable a trace event filter to the previous -e event",
 		"	     --trigger <command>: enable a trace event trigger to the previous -e event",
@@ -650,13 +650,7 @@ static struct timerlat_params
 			break;
 		case 'C':
 			params->cgroup = 1;
-			if (!optarg) {
-				/* will inherit this cgroup */
-				params->cgroup_name = NULL;
-			} else if (*optarg == '=') {
-				/* skip the = */
-				params->cgroup_name = ++optarg;
-			}
+			params->cgroup_name = optarg;
 			break;
 		case 'D':
 			config_debug = 1;
@@ -719,14 +713,8 @@ static struct timerlat_params
 			params->stop_total_us = get_llong_from_str(optarg);
 			break;
 		case 't':
-			if (optarg) {
-				if (optarg[0] == '=')
-					trace_output = &optarg[1];
-				else
-					trace_output = &optarg[0];
-			} else if (optind < argc && argv[optind][0] != '-')
-				trace_output = argv[optind];
-			else
+			trace_output = parse_optional_arg(argc, argv);
+			if (!trace_output)
 				trace_output = "timerlat_trace.txt";
 			break;
 		case 'u':
diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c
index d6ab15dcb490..bd5f34b44648 100644
--- a/tools/tracing/rtla/src/utils.c
+++ b/tools/tracing/rtla/src/utils.c
@@ -959,3 +959,29 @@ int auto_house_keeping(cpu_set_t *monitored_cpus)
 
 	return 1;
 }
+
+/**
+ * parse_optional_arg - Parse optional argument value
+ *
+ * Parse optional argument value, which can be in the form of:
+ * -sarg, -s/--long=arg, -s/--long arg
+ *
+ * Returns arg value if found, NULL otherwise.
+ */
+char *parse_optional_arg(int argc, char **argv)
+{
+	if (optarg) {
+		if (optarg[0] == '=') {
+			/* skip the = */
+			return &optarg[1];
+		} else {
+			return optarg;
+		}
+	/* parse argument of form -s [arg] and --long [arg]*/
+	} else if (optind < argc && argv[optind][0] != '-') {
+		/* consume optind */
+		return argv[optind++];
+	} else {
+		return NULL;
+	}
+}
diff --git a/tools/tracing/rtla/src/utils.h b/tools/tracing/rtla/src/utils.h
index a2a6f89f342d..d8d83abf0f0d 100644
--- a/tools/tracing/rtla/src/utils.h
+++ b/tools/tracing/rtla/src/utils.h
@@ -24,6 +24,7 @@ long parse_seconds_duration(char *val);
 void get_duration(time_t start_time, char *output, int output_size);
 
 int parse_cpu_list(char *cpu_list, char **monitored_cpus);
+char *parse_optional_arg(int argc, char **argv);
 long long get_llong_from_str(char *start);
 
 static inline void
-- 
2.48.1


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48])
	(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 D6C3E1F30A4;
	Mon,  8 Sep 2025 02:06:19 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1757297181; cv=none; b=peAXsDiW8J05rps9gFjAupeqt70cjlVhJfDQsMjHv/lmDxaFtD2ujvET68yef5CJgBpE6BMtBSGXnT3B1bNOh/ais2g3eo4YkeESotWuwrdAeBkKivoO3EPjyyy0zGiz0um4vcQj4NGNdHGjNHHw6DBQn6LwTXpUxi/7RpN9Fsk=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1757297181; c=relaxed/simple;
	bh=us1QFzHM3F3Tx5gbB5Xm3+iG8ZcTVYz+MmsqUabv0Ek=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=R8ANH/Cg0mYGZolRLv4RC4B0usu0sPrTIpfTdJAiJlOtt5L+TXZZZ8dsJvwkkb7H9dNlJmDP8eD3gkDL7KxO1YO3T/Ls7jNkje0SM49BupWmVgGLQF0w/kRZM5+IENoMWjjgMtX2WbDneMPDdrfmGNu05cYMOMoeI9RPdUHVvS0=
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=cRnZS0lD; arc=none smtp.client-ip=209.85.219.48
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="cRnZS0lD"
Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-70ba7aa131fso45198106d6.2;
        Sun, 07 Sep 2025 19:06:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1757297179; x=1757901979; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=oaBAcVJZNA9ab0l53ugbMEso8fa/CwAwMsudSNPp4o4=;
        b=cRnZS0lD9FtO77RKFu/PT8A5VmIw7ZZbuL+etD0QxF0dg9Q81SCl4gd9TYHr/8+Ntf
         sqPlng/SkarW2Lib3T2rnuoPT9J0reAIQGic+Kp2PojRhC8lS5RkTc4SOpv4w9g1yx1W
         Ps8qB4t7SdpEZmEL9XJ22YVkVQIT1hClkmXsrPSAggjRtTucjc3Kqwth7JGb7NymKYwH
         CPwKTocWv3l0gZudEGycsXejWzeqqujBUbkFEg6e8lwP2s49GLvxTM9b6EASKmlWwFJu
         zzlkWwhBN+sGEARgW969lkMJJtWunvk48PA/6bjkBmbaZoKotoajiWgDjGMVRfpySTuI
         QPVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1757297179; x=1757901979;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=oaBAcVJZNA9ab0l53ugbMEso8fa/CwAwMsudSNPp4o4=;
        b=hOGGJBrf7x065D1AuAawFYKOejDbanO2Zla0In4RXFSHm9DD/sSTAu9HrGTvjClkL9
         I2GUVY3/Qzj6pgWdEdEAkbkUJVfcD7L/b77fZVRxuWZcQ62k9qR0mooE9G6qsC5mE93l
         1DJveN3nLV8Ds4FcbZfgmIUoZb89jyKOoWg92Zab/Tf/eDENskvxL/tvhAsSrpsm/25T
         Z6Smzz1BVCXNalYfAH97B7eBPo0sEc+swUFw2RsFXUgAa0NUm+cr9n0Y2iGzI5Npnj1P
         LTn5Z750Lvd2xXy49mHviVsuvuEOYgOXpJUtPqUu2xtdYZ4hTEFB4ls0RLih1Q+dZ4xH
         WIng==
X-Forwarded-Encrypted: i=1; AJvYcCU0x6BEJS5qloxirIl+QELOQlTqC3/KrJ02sqQSd9cNDfYPTfgHq8OZdc92yHvC+EMNzolaIs4cm8WxQRM=@vger.kernel.org, AJvYcCV2PEeQxQPnrdIqLJtiKXQ0jeFheMLs6UD5YdOJKYFd2PZCdv7UgQlQBZbYBPIAVSUzSz3R94bNEHHYf5MQnx7yDD69@vger.kernel.org
X-Gm-Message-State: AOJu0YwTPUvoUPjaCIxJzBjGhRO6GSEmVdyosQO+q8G6O7fQCzp94O/h
	0VcUfEM6m55Qwj638iYDe+s4atS0xPzRc19BL0/E0xJgDavmmTyAaTHL
X-Gm-Gg: ASbGncvcm76rovw8GiAjZgXL2wfwfl2nix30v79JBPvFcR9VligAd73VEM3soKOnpCr
	wNs+3x+FKjIriDhYER+z7sWKFqrvIfb4UyRxW56GZLl7H2WcaFB+7K/OXMc/hg9PLQYiQxnfzss
	VVoQNXYNPAPErIYFcJF84M2v+FaUgILT0Ys2rJwFgGIiXQhIEMFXeMlE7IWhCF6/ST8xm6O6z9x
	rYPO1INtsEvVDK25w8csOXd/Fi3NEG+pup5aqb8/K87wtI3lr51qOlhH0EsGcUNc5BaREHwx+vp
	QEgcqhMtboSMDa1kt+BcogyFjt78tX7rGtHzVgQqkytEhBZDKfuf31CQL5YHf4qMZtzz5TWV504
	S4xXYtucZQpp3Nb9QLH3S+wc0oBeaQUM2sRJXlnqu31SoJtTjzJTNMk5e2FviyrULMR0DTNV5aS
	eDSh9Ihs7s+vFjOBFIlw==
X-Google-Smtp-Source: AGHT+IHZ/hD01zVbSdcsMLdVqx/W+/+CcThF2p0btDBB01OxOdC6PVomOpWDgdx2a2KJFxUAqssFWQ==
X-Received: by 2002:a0c:f119:0:b0:739:f004:a176 with SMTP id 6a1803df08f44-739f004a468mr57212566d6.39.1757297178592;
        Sun, 07 Sep 2025 19:06:18 -0700 (PDT)
Received: from ideapad.solutionip.com (wsip-184-179-113-83.ri.ri.cox.net. [184.179.113.83])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-72925b87571sm79638846d6.6.2025.09.07.19.06.17
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 07 Sep 2025 19:06:18 -0700 (PDT)
From: Ivan Pravdin <ipravdin.official@gmail.com>
To: rostedt@goodmis.org,
	tglozar@redhat.com,
	linux-trace-kernel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Ivan Pravdin <ipravdin.official@gmail.com>
Subject: [PATCH v3 3/3] rtla: fix -a overriding -t argument
Date: Sun,  7 Sep 2025 22:05:59 -0400
Message-ID: <e4a61cf3416c9b2a2c4952cbc93b4b05a7c3a37e.1757034919.git.ipravdin.official@gmail.com>
X-Mailer: git-send-email 2.48.1
In-Reply-To: <cover.1757034919.git.ipravdin.official@gmail.com>
References: <cover.1757034919.git.ipravdin.official@gmail.com>
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When running rtla as

    `rtla <timerlat|osnoise> <top|hist> -t custom_file.txt -a 100`

-a options override trace output filename specified by -t option.
Running the command above will create <timerlat|osnoise>_trace.txt file
instead of custom_file.txt. Fix this by making sure that -a option does
not override trace output filename even if it's passed after trace
output filename is specified.

Fixes: 173a3b014827 ("rtla/timerlat: Add the automatic trace option")
Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
---
 tools/tracing/rtla/src/osnoise_hist.c  | 3 ++-
 tools/tracing/rtla/src/osnoise_top.c   | 3 ++-
 tools/tracing/rtla/src/timerlat_hist.c | 3 ++-
 tools/tracing/rtla/src/timerlat_top.c  | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src/osnoise_hist.c
index 1dc39de79d78..3aa74affac26 100644
--- a/tools/tracing/rtla/src/osnoise_hist.c
+++ b/tools/tracing/rtla/src/osnoise_hist.c
@@ -543,7 +543,8 @@ static struct osnoise_params
 			params->threshold = 1;
 
 			/* set trace */
-			params->trace_output = "osnoise_trace.txt";
+			if (!params->trace_output)
+				params->trace_output = "osnoise_trace.txt";
 
 			break;
 		case 'b':
diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c
index b3e161536ed8..6bcb8d10c342 100644
--- a/tools/tracing/rtla/src/osnoise_top.c
+++ b/tools/tracing/rtla/src/osnoise_top.c
@@ -383,7 +383,8 @@ struct osnoise_params *osnoise_top_parse_args(int argc, char **argv)
 			params->threshold = 1;
 
 			/* set trace */
-			params->trace_output = "osnoise_trace.txt";
+			if (!params->trace_output)
+				params->trace_output = "osnoise_trace.txt";
 
 			break;
 		case 'c':
diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index ad713dafa3c3..f845d5fa8141 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -874,7 +874,8 @@ static struct timerlat_params
 			params->print_stack = auto_thresh;
 
 			/* set trace */
-			trace_output = "timerlat_trace.txt";
+			if (!trace_output)
+				trace_output = "timerlat_trace.txt";
 
 			break;
 		case 'c':
diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c
index 7f1885018624..42d85ea2e996 100644
--- a/tools/tracing/rtla/src/timerlat_top.c
+++ b/tools/tracing/rtla/src/timerlat_top.c
@@ -625,7 +625,8 @@ static struct timerlat_params
 			params->print_stack = auto_thresh;
 
 			/* set trace */
-			trace_output = "timerlat_trace.txt";
+			if (!trace_output)
+				trace_output = "timerlat_trace.txt";
 
 			break;
 		case '5':
-- 
2.48.1


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ECB1243367
	for <linux-trace-kernel@vger.kernel.org>; Thu, 11 Sep 2025 11:30:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1757590215; cv=none; b=dPB46pgAjRW+0osZiEz1yXxlz1yWzWTfXY1bi2V78uyht+vqQJs5t+H3wTzROCl7KzhWrepT1/Jtlu4DCkxPdYOo5IEoQz5fGDLiTTdd0EWH8Oo6+bkoncLrkN5BUrjqOEevxBLrFY5yonSVgpM3aiYVH4cbFR9hzhVRlIYKZNc=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1757590215; c=relaxed/simple;
	bh=NUmiUFiqfUg6KgSkyEEB4x1tZCu5PrZcN4T6cI6Oiyc=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=BpXRLXOf5J18kz6IfUvGHMYwSX05qdvsTzIWvz6ufQYGAWmPeSB1YZzLra9/Qt7ekI4LTc+dEkn+f6YS6eaJB48zxZ/oK1K1Py1G72c6bg+T7Hz2YprP19tRMRJG3JZMDPgPjXD4RLlDywgEDnhPnbUQjRafmW9bHjYUwAOgKWU=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=fwFaA+vg; arc=none smtp.client-ip=170.10.129.124
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fwFaA+vg"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1757590213;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=NUmiUFiqfUg6KgSkyEEB4x1tZCu5PrZcN4T6cI6Oiyc=;
	b=fwFaA+vgpU9xZuo+01BlbtZmEGTeuCaa94JaZa3Gx9OLiYE/YS2JPaLHZHza22nsva2K0s
	mLjtJp56e4hVba1sLIAOAjQ1ZunL8uDOckr0ZI9aPZNahybscqNVOchUP28kv5tMeaMZwx
	zUaE6l5StAby89WD5iP0jR8z5sCtjwY=
Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com
 [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-539-v86A4UUGOK2zsKWew4ZsSg-1; Thu, 11 Sep 2025 07:30:12 -0400
X-MC-Unique: v86A4UUGOK2zsKWew4ZsSg-1
X-Mimecast-MFC-AGG-ID: v86A4UUGOK2zsKWew4ZsSg_1757590211
Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-b0787fed7c0so58628466b.3
        for <linux-trace-kernel@vger.kernel.org>; Thu, 11 Sep 2025 04:30:11 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1757590211; x=1758195011;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=NUmiUFiqfUg6KgSkyEEB4x1tZCu5PrZcN4T6cI6Oiyc=;
        b=NpjP2A5qSy1GxAolMfb2RJ06jRhLrzI0bWJH1rQ6WfSpasDb0woTR3djXhn4Qi/M+i
         7zZVubve+xZcDytdSC0UdNi7TxAfrrWblydibM1u3QCPh+86X1384CDtkAWalIcJPhvc
         /odA8ZrmMrUGp7f/1PwI2akXxo+6CEG+WUwbWq0m1PbT66Oj1tjGjDGjBGMJ8mK/UYeL
         iD9gl/kzXdCxd1vP/o4K2y0xdElkqGEafrbouPTjTl4zE5XCThR8+TXpobJ+yY40pH1P
         J1PG05oIfdGVuXJtkWmym8ECyNhYi1kwJ3oAcYDTY2P5PyCbwBosCsTjezwZaXxJ/pV6
         /0RA==
X-Forwarded-Encrypted: i=1; AJvYcCXsGwB9G150IkZ5eTRwW7IroeqXu+zfnKBnZSLOFlYJrW0AEW7crMBMF9YcsiWV/rnkWRwn4cis6XxU7cvsb7v84mo=@vger.kernel.org
X-Gm-Message-State: AOJu0Yye3UoVcK66RC/DlZP5CX6VGajk1NLclgyrP9XOV+fMvb3xdTfC
	4ww5wptAmazDuo/JnTjIah3JiGkRibjxT29rz0W3EhCOX8sQmtxE2U+dbSsKlN7ws4kNt0d9WIK
	t45ukqp7QJEpW6lwu9q4mB6YsyuK9iKBPbMLHGrk9OEXb+/bMMzr+JJ8DowXYysbec1LmWmBQUm
	0gPXQNfZYhrwcBiSK0U/HN/MZTMo69Q0yUvMpi2DCETCz1hAIP
X-Gm-Gg: ASbGncsJyBNDP3fnHDHiGXrY3kCqIaZacY35AhGpGFis7gixc7sy2icjPQ2smnvnOcS
	nYSHd/icx8EeEpIhORrC8X+NUr7osgOebmH5+XjE9lUvzA5XeMSIgL3eQz9FzhfMo/fRRFOdUfX
	nvyVpF/BlqWzr92rjR20c=
X-Received: by 2002:a17:906:7308:b0:b04:ae68:afdf with SMTP id a640c23a62f3a-b04b14afdaamr1804647366b.28.1757590210887;
        Thu, 11 Sep 2025 04:30:10 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IEnABc+KFrFpfTUERSeqlhV9AtywAZEQJi2YB1sLvQMPoBwEtOIxY8SSmmHUt7hjQ06toD5GKHKNh8zL+UX7Lk=
X-Received: by 2002:a17:906:7308:b0:b04:ae68:afdf with SMTP id
 a640c23a62f3a-b04b14afdaamr1804645166b.28.1757590210487; Thu, 11 Sep 2025
 04:30:10 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
References: <cover.1757034919.git.ipravdin.official@gmail.com> <a093065d78b7a4377c084fb4dc56942aedc5f6f2.1757034919.git.ipravdin.official@gmail.com>
In-Reply-To: <a093065d78b7a4377c084fb4dc56942aedc5f6f2.1757034919.git.ipravdin.official@gmail.com>
From: Tomas Glozar <tglozar@redhat.com>
Date: Thu, 11 Sep 2025 13:29:59 +0200
X-Gm-Features: Ac12FXzz8um6-S3OMseB0U311Zcv84vqKdIlRtKjeumvmaIu22hPwQtw_OK_DKE
Message-ID: <CAP4=nvTZN6G+KAovidAZbYNt8Ubh64bfkKVDUMDCJVwPO+=DNQ@mail.gmail.com>
Subject: Re: [PATCH v3 2/3] rtla: fix -C/--cgroup interface
To: Ivan Pravdin <ipravdin.official@gmail.com>
Cc: rostedt@goodmis.org, linux-trace-kernel@vger.kernel.org, 
	linux-kernel@vger.kernel.org
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: Y4UeP9bVbKNRwAcdm5KMIRoXd4BU5yZD7Ct82EFQZcQ_1757590211
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

po 8. 9. 2025 v 4:06 odes=C3=ADlatel Ivan Pravdin
<ipravdin.official@gmail.com> napsal:
>
> Refactor identical logic between -t/--trace and -C/--cgroup into a
> common function.
>
> Change documentation to reflect this user interface change.
>

Looks good to me, thank you for implementing the refactoring, now that
the logic is shared.

Reviewed-by: Tomas Glozar <tglozar@redhat.com>

Tomas


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 051121D5146
	for <linux-trace-kernel@vger.kernel.org>; Thu, 11 Sep 2025 11:32:22 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1757590344; cv=none; b=CzZAnFCAamjk7zg3SghWYrKH3y741nFzil49XWnuy6U5f8tH6h+3ZawzOwYyAQqwwxav1T8fIrXnupK8qAKZ81GEW8YoJEGY778Iz7dbk5BUdZlN83H9ObiK0l/F9wq1Rf0qgX12fbiLaKAGwE+9br2CGXNChMX7DmHJN/TkBtU=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1757590344; c=relaxed/simple;
	bh=vU7YIeqeNnP2WZniRMFC46l0QlmEBf+apmlt516M9/w=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=hA0FwlshHBCzsz81Vr3tBwTrZ9tVNSevwaJY6ZZAQvWDsBPpAeOQM/lh0WFfK1jqxlTUqd9OyFbnXFXcs0kZ8qQLgietyX0rL0mIUPSsncfWYzewhxKueSoePqm2WweXgj3LN9d7l56Cu83RvEQAL+v67QX/LQ2skTlnSPFiQ8c=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=fRDBpeG5; arc=none smtp.client-ip=170.10.133.124
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fRDBpeG5"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1757590341;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=/uv9xgEOBHqilZta2Ov9hEM6jLUDZQaOycayp6o0rFY=;
	b=fRDBpeG5neSF8OMp52p9TdEoXTePBC5l+88laz0EMLQIIfmzGMHR0nLqcQvfoB4aFe00NO
	30Jjy8QBoo0OZObDP/+R4wbaPxhwZ5R9NblVup4IS2CmQt7DNmK26zC5H+d3mqdfsjFGnl
	zBPmHHx1FJ3CKtXPqo+xvLXYM5v62W0=
Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com
 [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-576-j9NGrcu-P8689H6nzcj5bQ-1; Thu, 11 Sep 2025 07:32:20 -0400
X-MC-Unique: j9NGrcu-P8689H6nzcj5bQ-1
X-Mimecast-MFC-AGG-ID: j9NGrcu-P8689H6nzcj5bQ_1757590339
Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-afe81959e5cso62342666b.1
        for <linux-trace-kernel@vger.kernel.org>; Thu, 11 Sep 2025 04:32:20 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1757590339; x=1758195139;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=/uv9xgEOBHqilZta2Ov9hEM6jLUDZQaOycayp6o0rFY=;
        b=r+LgDWwzMwusLRKjjGUCBH9vb3yR/geA+M1xCWKfTc/MyTSC9J/EmVAABSUV3oFpao
         O7B5TgVXuyiNemzeSfpckVfLgn0/m3K9oR7JuL7JHAX+ckxA43BCy1tfOZ6SWaSfu7yE
         j9ApBn7RucrwPT84Wc4HzRGCHEpznBr8n7Z3aKB4LMsqeBnBO3Lc4UZqA+KXD4EM67lf
         VSNg/PL7BNgDDD+iaPgpYpLvfmc7kTcTH6Jr/ae4k72MpsoDcoUhFPAwxpG3C83kLcq9
         OYfQbncCRK2IqM8i83UmOG5uOpUisHgqkT6y9oA/LxBjrxhihm4ZauZHi2oqV/XGdh4e
         fOTQ==
X-Forwarded-Encrypted: i=1; AJvYcCUaiIz0vMLmiML1NkToXeHaw1cn/rMUkO7iRt6/xZ6Rv1FIFSMRLYAdJ5K6j3AQb3Y8m8csXpZfaKew2tA6xUgMSfU=@vger.kernel.org
X-Gm-Message-State: AOJu0YyqQXp+sgP7UXWHKKH/S3qlaLWyDjS9xSePhxm1SpGbSPrxggeu
	5iu1kvIB9wnW3vDnCpL/YyZHmVbsqJNKeybsz9VntgWJFkMk+fC43vMgima3yXBJL90PqKOZSHP
	ywQKHx64wTU3NmdDNNu0aHocvhs7OwQpB3y68W0AJeun3SFRZ5eJkR67tZYSabYfowOCByLbweR
	PTZaCJGN4n1lnMF+FaodueO+ZwrmcgEpMKbrgZ9RelkBfdAqQS
X-Gm-Gg: ASbGncvtGqFK3vZEEPBmFcm9g7+NMO8tDFyQGbaRE9v4ZIYK013a0W3UKRAQVwJy65E
	scS9XeFELeyuZ9M3D5ZIfQMjwLg1mWNdVX32GBMTnz91YnfwFm2WzJUzppYK2Jg2KT7sMs2RJkz
	u1UJX3nzXYADykGjiRq4U=
X-Received: by 2002:a17:907:3c8c:b0:b04:59c4:d90 with SMTP id a640c23a62f3a-b04b16dec24mr1845701266b.46.1757590339239;
        Thu, 11 Sep 2025 04:32:19 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IGtryqqhK5XPWAJhTYmS3Rl3cuFSHJKIBlPP4B+UZlUQID8WzNfFKtrFMbWlVE4yUsMN7bd8dbWKx+GhAt6xWU=
X-Received: by 2002:a17:907:3c8c:b0:b04:59c4:d90 with SMTP id
 a640c23a62f3a-b04b16dec24mr1845699266b.46.1757590338837; Thu, 11 Sep 2025
 04:32:18 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
References: <cover.1757034919.git.ipravdin.official@gmail.com> <e4a61cf3416c9b2a2c4952cbc93b4b05a7c3a37e.1757034919.git.ipravdin.official@gmail.com>
In-Reply-To: <e4a61cf3416c9b2a2c4952cbc93b4b05a7c3a37e.1757034919.git.ipravdin.official@gmail.com>
From: Tomas Glozar <tglozar@redhat.com>
Date: Thu, 11 Sep 2025 13:32:07 +0200
X-Gm-Features: Ac12FXwHkQLXa0LpbeudjoMzTGDDC_VEcWtyIxBvhBzukc22YS3jY0V4NabCWWU
Message-ID: <CAP4=nvTWmoZ8FvoLJK6R4ZJ+LW_4pp2WDcKqBNBt7pLjVfL0zw@mail.gmail.com>
Subject: Re: [PATCH v3 3/3] rtla: fix -a overriding -t argument
To: Ivan Pravdin <ipravdin.official@gmail.com>
Cc: rostedt@goodmis.org, linux-trace-kernel@vger.kernel.org, 
	linux-kernel@vger.kernel.org
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: BAFYXmVwT2oEeAv31UKLaFDQPNSUDRZlKFy-3S5Njyg_1757590339
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

po 8. 9. 2025 v 4:06 odes=C3=ADlatel Ivan Pravdin
<ipravdin.official@gmail.com> napsal:
>
> When running rtla as
>
>     `rtla <timerlat|osnoise> <top|hist> -t custom_file.txt -a 100`
>
> -a options override trace output filename specified by -t option.
> Running the command above will create <timerlat|osnoise>_trace.txt file
> instead of custom_file.txt. Fix this by making sure that -a option does
> not override trace output filename even if it's passed after trace
> output filename is specified.
>
> Fixes: 173a3b014827 ("rtla/timerlat: Add the automatic trace option")
> Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>

This part is good, the only problematic bit was the clear_terminal stuff.

Reviewed-by: Tomas Glozar <tglozar@redhat.com>

Tomas


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4A04C8FE
	for <linux-trace-kernel@vger.kernel.org>; Fri, 26 Sep 2025 14:33:07 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1758897189; cv=none; b=lbsYqkGnMeJjGa00lSYBEtrmpLChT5WT3iVHs7TRBom/TyJ5W7lBs9sA2ku8KdEltYCmS9AxBgWCe0SoyPeZEEBSRgNKwbE1cKJ+LtQ78Exnk5wmwoUa/NlRk6tDef3r7QQTwnl0rq8HSyQcH075wfAHQmxwsmFbjRDUIPIRm04=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1758897189; c=relaxed/simple;
	bh=zyzn3ZcezAK9aa7VZIAtRCcKzdP/B8eYrPAfL36Gs6s=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=KjmE5f//7OcSAj129o00NvwGeWO7ppGU8JFpGM0zTrcbRzgdvtw6qCSZRh1lWhmAyqlNpBVnnK5dF+Srt5lbqI/5awasienjOuv1CjrkH50N8iql2vC8iI2yl3jRdk8oPCkqqjHZif2m+NWb4uwakMMTjlKj56GjZIL5L0pZv+U=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=USA+vZf2; arc=none smtp.client-ip=170.10.129.124
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="USA+vZf2"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1758897186;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=qOJaLah4ePiQxdQez6Be1i94MUmLOsj+O0iioPNAuew=;
	b=USA+vZf2QMK2pDvamwg5VB3hN6qEm+HBp6Qo3+puUCvUmKTr3kJKD6rdj7Tco+E7cwIURh
	4dU4/moVACg8xUmjivu1WnwYT1VftFmEbZQlRl3bcILDT41CxeqEVpOTbZwZQe0iGJ/c0U
	o6Mv1kHHXYkeluES2JX+Ud5+bNRinl0=
Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com
 [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-617-lMXNMARdOb6LtdcQOCBL8g-1; Fri, 26 Sep 2025 10:33:05 -0400
X-MC-Unique: lMXNMARdOb6LtdcQOCBL8g-1
X-Mimecast-MFC-AGG-ID: lMXNMARdOb6LtdcQOCBL8g_1758897184
Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-b2f989de76eso416333866b.1
        for <linux-trace-kernel@vger.kernel.org>; Fri, 26 Sep 2025 07:33:05 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1758897184; x=1759501984;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=qOJaLah4ePiQxdQez6Be1i94MUmLOsj+O0iioPNAuew=;
        b=wFQpgJoKRbS7wikPt6+1UYJgygfRqTyyI44r/UcBBnl75JdSeHoArQB0S2qGgDDJ5o
         SHC63MaWGT1OFODtcoEKRZxLzW/Yk298yurs56JGAor0IrzYDTi+mG6uQCwKY3FuugvJ
         0capC0HxQytjA/zP7Z/i0Q926EZppBj8ms1Hvznbz9fawO0CaQxlXAyXhf6Cb76C6XyA
         LvhRv7WUJflWthfeXmXI9BfxR2f1WtzlgZqI6zrHG4SYQih4/BypcnG5mD87BXV1lzUi
         qnIJuv4pxrPG4vKoabzQDnYEItlhtxcYCS+IU1R5rSqR59tFDnbgXmW+PsFAI+vu0R3L
         NWPA==
X-Forwarded-Encrypted: i=1; AJvYcCVWtm69V+S5elu+bk6QkxWQAcsRrAyTLPLv7xw84Zv/6Ci7GcAXO6w0MN3M6/f/dFrMpjok09kMUgu/P8bdX/l+FXs=@vger.kernel.org
X-Gm-Message-State: AOJu0YzFQ5Yf5yN9nXPp4ZQsSxsNiVrfn+vrv6zmS3x/zV3QKjLMzKwf
	esK8o0zcq1FQiCCm3XxdVj5lEdVUYx6+YUQVp2wjpr0EtoLkBN7ZtmO+p3ykAX0/nS48rZQboXL
	EYQe4oQbQO4rZqbDM0m9u7bhxdomnc8xnjNof4bi+0UjNPyuq5FcUKW9UogxHiNN9LwY4HNuPkt
	Vqq20X8fnyLwqsv/jw2PWiZfcF1ptg7W8P6RNRssGEEA3Ltep6
X-Gm-Gg: ASbGncs/VPjQ/pBQu5qKZAfCa2CZyX6a5gtM9ms/oa5AVIzR3qTbgrvRV6lXc1MU+I+
	8IF08vYSZSBzGCWam+EvZg/OREvmuMf7uvOwA7xNDYnw2YnFRzabax2DT4irYapqljLFDJJWEE2
	TaxXCsUSRZKJUq+zuEaQcm
X-Received: by 2002:a17:907:93c7:b0:b07:e348:8278 with SMTP id a640c23a62f3a-b354d73f016mr505472966b.25.1758897183984;
        Fri, 26 Sep 2025 07:33:03 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IESo+itkF3w4Rk3YxWgiaRXreqg0X/y6Z1uD9ARYPdkidf9i+Pmr8YhdRDy8sGsq6sp96MKGBRKUhp9lPqQJf8=
X-Received: by 2002:a17:907:93c7:b0:b07:e348:8278 with SMTP id
 a640c23a62f3a-b354d73f016mr505471066b.25.1758897183586; Fri, 26 Sep 2025
 07:33:03 -0700 (PDT)
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
References: <cover.1757034919.git.ipravdin.official@gmail.com> <164ffc2ec8edacaf1295789dad82a07817b6263d.1757034919.git.ipravdin.official@gmail.com>
In-Reply-To: <164ffc2ec8edacaf1295789dad82a07817b6263d.1757034919.git.ipravdin.official@gmail.com>
From: Tomas Glozar <tglozar@redhat.com>
Date: Fri, 26 Sep 2025 16:32:52 +0200
X-Gm-Features: AS18NWCTGFAnet0Nl0vdl1CmepDisUb588HKCFc7aZTYKNqaEC4lLhouSKrNNuM
Message-ID: <CAP4=nvRPXq=_WterXhaxk1ZwDSPwkJbVJP0L+ze-Cjw1foqK+Q@mail.gmail.com>
Subject: Re: [PATCH v3 1/3] rtla: fix buffer overflow in actions_parse
To: rostedt@goodmis.org
Cc: Ivan Pravdin <ipravdin.official@gmail.com>, linux-trace-kernel@vger.kernel.org, 
	linux-kernel@vger.kernel.org
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: _mmE6zbVi8Y6_PINO6fQJ_naNpQAhBB2ZCP6sxhYQ9E_1758897184
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Steven,

po 8. 9. 2025 v 4:06 odes=C3=ADlatel Ivan Pravdin
<ipravdin.official@gmail.com> napsal:
>
> Currently, tests 3 and 13-22 in tests/timerlat.t fail with error:
>
>     *** buffer overflow detected ***: terminated
>     timeout: the monitored command dumped core
>
> The result of running `sudo make check` is
>
>     tests/timerlat.t (Wstat: 0 Tests: 22 Failed: 11)
>       Failed tests:  3, 13-22
>     Files=3D3, Tests=3D34, 140 wallclock secs ( 0.07 usr  0.01 sys + 27.6=
3 cusr
>     27.96 csys =3D 55.67 CPU)
>     Result: FAIL
>
> Fix buffer overflow in actions_parse to avoid this error. After this
> change, the tests results are
>
>     tests/hwnoise.t ... ok
>     tests/osnoise.t ... ok
>     tests/timerlat.t .. ok
>     All tests successful.
>     Files=3D3, Tests=3D34, 186 wallclock secs ( 0.06 usr  0.01 sys + 41.1=
0 cusr
>     44.38 csys =3D 85.55 CPU)
>     Result: PASS
>
> Fixes: 6ea082b171e0 ("rtla/timerlat: Add action on threshold feature")
> Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
> Reviewed-by: Tomas Glozar <tglozar@redhat.com>
> ---
>  tools/tracing/rtla/src/actions.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Could you take this simple fix? (Might require tweaking the starting
letter "fix" -> "Fix", I don't care that much about it, but as you
said, tracing requires capital letters there :) )

The rest of the patchset conflicts with [1] but this one doesn't and
is also more important.

[1] https://patchwork.kernel.org/project/linux-trace-kernel/list/?series=3D=
999703

Tomas


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D1791F541E;
	Sat, 27 Sep 2025 09:59:35 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.13
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1758967177; cv=none; b=bIb7xEEcNb3Ilrdaf4zzaxpT82WH4oNvmRmF3849BipWV79xBoo8rtjCSjL9T2f4PbxjRKTVp1fNxHAS/pW0uux3PqWVlEX3dMXgtmdben+JQ4MjRN6WlOSPlgNkCIRDpX+DBnoVqtu2qjmpXo1JdLx3rHONEUYCpaZZjMecc5E=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1758967177; c=relaxed/simple;
	bh=fO3nSZSSiqaLLzXsOhX7igmuCudDiWZKHARGLOnekhs=;
	h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:
	 MIME-Version:Content-Type; b=B1oibeMg2N2iSRoD+6FIABO7WWI7d0tQbRSzLmeA+Nis/Qesv0ZCEjqH8iK3hQDcKCGu82dYiSiuuq54R/TNZZFyQFEhSDGQ/KP9EPx++pAf/98aS+dRoM/9NPQagaLhiwbo+nD9N77+kDG0+LUtq9BwcULNHYdinphGTv/dVm8=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.13
Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org
Received: from omf04.hostedemail.com (a10.router.float.18 [10.200.18.1])
	by unirelay02.hostedemail.com (Postfix) with ESMTP id 2E6AD13AEA3;
	Sat, 27 Sep 2025 09:59:34 +0000 (UTC)
Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf04.hostedemail.com (Postfix) with ESMTPA id E3A7420027;
	Sat, 27 Sep 2025 09:59:31 +0000 (UTC)
Date: Sat, 27 Sep 2025 05:59:27 -0400
From: Steven Rostedt <rostedt@goodmis.org>
To: Tomas Glozar <tglozar@redhat.com>
Cc: Ivan Pravdin <ipravdin.official@gmail.com>,
 linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] rtla: fix buffer overflow in actions_parse
Message-ID: <20250927055927.2db5aa50@batman.local.home>
In-Reply-To: <CAP4=nvRPXq=_WterXhaxk1ZwDSPwkJbVJP0L+ze-Cjw1foqK+Q@mail.gmail.com>
References: <cover.1757034919.git.ipravdin.official@gmail.com>
	<164ffc2ec8edacaf1295789dad82a07817b6263d.1757034919.git.ipravdin.official@gmail.com>
	<CAP4=nvRPXq=_WterXhaxk1ZwDSPwkJbVJP0L+ze-Cjw1foqK+Q@mail.gmail.com>
X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Stat-Signature: 1rdinnz9fxinrjjr1iyffd9z9oekye8j
X-Rspamd-Server: rspamout07
X-Rspamd-Queue-Id: E3A7420027
X-Session-Marker: 726F737465647440676F6F646D69732E6F7267
X-Session-ID: U2FsdGVkX19bzIHE6O6+HhuldinUylDUmYfvUvPbMgQ=
X-HE-Tag: 1758967171-670296
X-HE-Meta: U2FsdGVkX18yEDxk/iBRbuWzmRDZr7kRHa2UK2z2hfaXOSSqLkfy3sL992L1TPoMnST+SDCm6t2MxNBk7gSkwFz5L9a1+Miqh6Jv8kDglgaqQkJJt8rV9TscLZhH21g7ZC3mkPvjTWP084YkU43IvQ1NTu7EKtTwHVqEMGojedSGNDWcJSeSUr+45WvCHn/KGj/TmI1cnaDVqivKtBn+p/93jQXpM7aTuedMKe0I6Pa62fuF1Tbona23yEKqC+giA8RgORYpdz1lJxTSQaw+aZB9uylzntwNWTGvExCd91nb2cEWEltPbxkEncnAWKa+0w+NDW6+7HJjGXK/JFYqzqAMlQWJl3wk2pEGhkekKGXbAQy/0AwfTg==

On Fri, 26 Sep 2025 16:32:52 +0200
Tomas Glozar <tglozar@redhat.com> wrote:


> Could you take this simple fix? (Might require tweaking the starting
> letter "fix" -> "Fix", I don't care that much about it, but as you
> said, tracing requires capital letters there :) )

Yeah, I can update it.

> 
> The rest of the patchset conflicts with [1] but this one doesn't and
> is also more important.
> 
> [1] https://patchwork.kernel.org/project/linux-trace-kernel/list/?series=999703

Should I expect a v4 on patches 2 and 3?

-- Steve

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176])
	(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 8F09A2FAC12
	for <linux-trace-kernel@vger.kernel.org>; Mon, 29 Sep 2025 15:13:55 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1759158837; cv=none; b=Fx5cNjjd/v39yGoBA0Jvd77BxTzDq+zHGwceX9sEF0wYJr9VRFIGL9Zkyd1JmCh6n8jdozx32HMhKHWxY1FJT9m7QNSR7qW9I6BR6f624qb0kzhIzjpkU7/TsSG4bFFKDSCj7O/LNlNE0VrajQAuPx+smQJaY9RwxHFN9aEdvXE=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1759158837; c=relaxed/simple;
	bh=Q5xpCZtgoUmeiOI3wsnnzH9U/v0JlgZLcFjeUxgaTkw=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=UfYdf+AAqN6Vtk8VazWWHNUfQDcFHKaZDWvinDk48tQQMaQmXznxCMmqDIRvGZtBMjOapTS12jUhqS5zddk+GY6tyAAfKLlkkWN6zQL8vUunES11qnvZH7G5a2F3DtCt6PZuXrPDVFzLppxxDPQxJr1lFmTYYg8I3KCoyQzQimc=
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=Sobuyq1T; arc=none smtp.client-ip=209.85.222.176
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="Sobuyq1T"
Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-85780d76b48so507723385a.1
        for <linux-trace-kernel@vger.kernel.org>; Mon, 29 Sep 2025 08:13:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1759158834; x=1759763634; darn=vger.kernel.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=o6mF9nQbD4LRSuancZRW+yv6VyfhCAoAUv0K8HNhZys=;
        b=Sobuyq1TTPOSp1ppry8MdGIH0EDaf0YibFBRcHfK/bFHhGC5IC1AqAT+UKqPH08wSG
         yKMBAArRUOCOW16yEP6bu6gxGV3OqFM4irM10e06q/j2ojB85WvW0AGhvSYH/O/XBgam
         dJLkBX0UJun/JDB0O4ikPzXc/9fyngnMZHnZxxiZBn1vv3vLx8MloGzXGIv/+kr6UlD4
         L75ngtKPZrp8DArcqwWWbQsCUtJdoQyitCqaNu9r+jB9yj9DXOlXt7vOwEipXsS/Q6lY
         0ozrrURlyClWlddvwnwoGZmUIyNECRNs7LYoYolPM7TUjlSJceKWhzM0KZ+BLvxalK7u
         Ai9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1759158834; x=1759763634;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=o6mF9nQbD4LRSuancZRW+yv6VyfhCAoAUv0K8HNhZys=;
        b=wcw0GHSgNpTeNsbvDVcjO+nuxZxkYquI6J4ToOPCjIbH+UWSKJOO/jEiglB1aWhPij
         nf2Pc9+FGKHB7i3eveZsfrP4fF6NL0bCJYvWGBau07jAO8EoUKmzR0vbZBZm5XDFWIoB
         W7sjL/+0vohlXCj46Hf7cP64AgZ1CcWX2s9iTrvmwttI6ZlsrVU3kXVJNlj+0xW8Ufkf
         5xuI0DpGD0fTciwCg/a6gMBnyDDzETDKKSJjcvUnCJHVu/kqcwzl49tnazotfccjm02T
         wOsk8FaXxXlh8aoY9JVuGdgkSxlL4AKzPT4F80x9zw3vUZ50oNxr2TMnHO5YXLLUFyZN
         LUeQ==
X-Gm-Message-State: AOJu0YzgclRKGDHLzoAVaG52stCFOi2zfwH0JZSBH4o99p0tOHg36q7H
	La2xUAkX9osdgJFL521RZvFbCjYyLHKYVApHXPb/A8GCq07dcd63ZNjI
X-Gm-Gg: ASbGnctiMgbFy0Dh/wbX97DoVjExiOl2SNMay+P4PEznRlL6HyQOuNtvyr8FrkYgdEt
	B2cpYukLoODRvRILF+eVJt2+OO8mPj5lq3hYlorbFKulP2ri/Lqw5RaxJD3zSXKq0/S9fBuo+zY
	74yeYPxTAdw3VQA4p9HeyRsognxJOot1MBtrC0o7zxjEwYyb1CKYWlyVjifi8Gbpwqj3F1X3cLb
	dIW65H4tckIuXTqYx0sa2QFlH98Sp8HDRhb/XV2ePWK3pnePrYb4xARelzLDUHtpOOI8ESu3wfz
	pE1H6igKL8JSgTcph2MLjG0j3761+JKws7QyskM0n/6ML6A5Iezi9kWy5VK5JdU49r++03McWZz
	rUcRtHBGh1hyBlpPTzxRrwAxL5ngSYUtHMF8=
X-Google-Smtp-Source: AGHT+IHcv3ftyH9hMXSkvfjyOuO+c5Je5bR/mBSz77yt6PmvfNC1qaPGB+c7uga1oDOrqUh5Arr+tA==
X-Received: by 2002:a05:620a:44d3:b0:86e:21a4:4740 with SMTP id af79cd13be357-86e21a44804mr227342085a.86.1759158834494;
        Mon, 29 Sep 2025 08:13:54 -0700 (PDT)
Received: from ideapad ([130.64.64.34])
        by smtp.gmail.com with ESMTPSA id af79cd13be357-85c2718e1basm882498785a.1.2025.09.29.08.13.53
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 29 Sep 2025 08:13:54 -0700 (PDT)
Date: Mon, 29 Sep 2025 11:13:52 -0400
From: Ivan Pravdin <ipravdin.official@gmail.com>
To: Tomas Glozar <tglozar@redhat.com>, rostedt@goodmis.org
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] rtla: fix buffer overflow in actions_parse
Message-ID: <gtchr4tuxau4gh5cfsm2rafyni77uuak2orros6byvw5dlzyyp@z6j7jojwegux>
References: <cover.1757034919.git.ipravdin.official@gmail.com>
 <164ffc2ec8edacaf1295789dad82a07817b6263d.1757034919.git.ipravdin.official@gmail.com>
 <CAP4=nvRPXq=_WterXhaxk1ZwDSPwkJbVJP0L+ze-Cjw1foqK+Q@mail.gmail.com>
Precedence: bulk
X-Mailing-List: linux-trace-kernel@vger.kernel.org
List-Id: <linux-trace-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-trace-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-trace-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAP4=nvRPXq=_WterXhaxk1ZwDSPwkJbVJP0L+ze-Cjw1foqK+Q@mail.gmail.com>

On Fri, Sep 26, 2025 at 04:32:52PM +0200, Tomas Glozar wrote:
> Steven,
> 
> po 8. 9. 2025 v 4:06 odesílatel Ivan Pravdin
> <ipravdin.official@gmail.com> napsal:
> >
> > Currently, tests 3 and 13-22 in tests/timerlat.t fail with error:
> >
> >     *** buffer overflow detected ***: terminated
> >     timeout: the monitored command dumped core
> >
> > The result of running `sudo make check` is
> >
> >     tests/timerlat.t (Wstat: 0 Tests: 22 Failed: 11)
> >       Failed tests:  3, 13-22
> >     Files=3, Tests=34, 140 wallclock secs ( 0.07 usr  0.01 sys + 27.63 cusr
> >     27.96 csys = 55.67 CPU)
> >     Result: FAIL
> >
> > Fix buffer overflow in actions_parse to avoid this error. After this
> > change, the tests results are
> >
> >     tests/hwnoise.t ... ok
> >     tests/osnoise.t ... ok
> >     tests/timerlat.t .. ok
> >     All tests successful.
> >     Files=3, Tests=34, 186 wallclock secs ( 0.06 usr  0.01 sys + 41.10 cusr
> >     44.38 csys = 85.55 CPU)
> >     Result: PASS
> >
> > Fixes: 6ea082b171e0 ("rtla/timerlat: Add action on threshold feature")
> > Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
> > Reviewed-by: Tomas Glozar <tglozar@redhat.com>
> > ---
> >  tools/tracing/rtla/src/actions.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Could you take this simple fix? (Might require tweaking the starting
> letter "fix" -> "Fix", I don't care that much about it, but as you
> said, tracing requires capital letters there :) )
> 
> The rest of the patchset conflicts with [1] but this one doesn't and
> is also more important.
> 
> [1] https://patchwork.kernel.org/project/linux-trace-kernel/list/?series=999703

Thanks Tomas. I will monitor it and rebase my patches once it is merged.

> 
> Tomas
> 

	Ivan Pravdin

