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 A5249218821 for ; Tue, 25 Nov 2025 00:46:40 +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=1764031602; cv=none; b=Ay3fZia7IcnO6xchI1pt05+j0VnD3DfVL2Z0cOM63D9UuaTzolVbF/Zdb2lbYWfbDGFzB+Ie0GXxRJ1BGqhTgoEwbpX2kMR631RJWT4KuZxH1f8wcmlaoNr5ZM5CvhlS6CPJqoztJ+u+xjSawUnneqS47qJCgWERbbzhZKXrmU4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764031602; c=relaxed/simple; bh=G3zh+yMK/TRKivltkP3mCqe+qC0Y3SskBQgYCuxwWBo=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=RygwDFyXh4cAgygjQGfTf5YANPGR8t4dXFcP1Rai2vw8IltD3aUDWy/UzXe+lR8cPi1n0tc6Xj8lSOkqgupPiH5Ia7sFbiB5T/jkFWygznRbWBJWS/4S2BsNskVZ+uh0EioAVqfv2ujmFMeE9jqEfPUj3xNWAI3POvqpHwiAGgM= 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=g9SUKl6/; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=A9rCZAWj; 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="g9SUKl6/"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="A9rCZAWj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764031598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rYQVballiQUNa7s18X6oVPWwoZUsXRJUaKrTG/soO4I=; b=g9SUKl6/H0p4zc71sL4MdS1yKfaXRCrQCYCFggiAHjVJu06pPFZku9pLt2vtfeAqcria+7 aILEUFpcFHsOgoGtXoo7OkGqjxPJLizfrUOwFnFNVc3Zr/Esn/Y7NeeAVBhwsrI1iW43Is eU4yx5XdQBzxueKXLxD7xv3HACyo6cM= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-o1bYVr2RN8Gr9c05xsY2vg-1; Mon, 24 Nov 2025 19:46:35 -0500 X-MC-Unique: o1bYVr2RN8Gr9c05xsY2vg-1 X-Mimecast-MFC-AGG-ID: o1bYVr2RN8Gr9c05xsY2vg_1764031595 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-8824b00ee8bso70882406d6.0 for ; Mon, 24 Nov 2025 16:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1764031595; x=1764636395; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=rYQVballiQUNa7s18X6oVPWwoZUsXRJUaKrTG/soO4I=; b=A9rCZAWjI2aWxYKEb57dEK/f8piO2fwvYLqHbQ+CBgm/5JRFnXPpgNLyuXA6B375cy KY/4ZjBNqKfwG8CwE+r3xmHSwOKp9YRIlUXfcDIgeeNJQNk93fUo9XKN4cr/v1whzpN0 3Om5mH+pOWvX5yfp5/XJrotcsISWT8BGdMvmqIaOHQsf1CI6g+5NgSYBw1wU479lZbcs qtSAAc52fw6XfddU6ItZQVyxZeExTDndWcb0j3oa4ZFSBWNyjvrreHqMerbXsxtP685d hweiwrsyhxjI18Yb8/BZyX7zuRAeYAUOk39JmEhgypVNnusc97B2Yc/ZYxVYEnZEGInO uyMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764031595; x=1764636395; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rYQVballiQUNa7s18X6oVPWwoZUsXRJUaKrTG/soO4I=; b=ouWiYFCLPVZSOTGosua/ykecTTNd5lB9TfHvN4uIw5DABTHup8QIj0u7p28rhcqzwU 7c/JOvuKkWvU03WWI+TEzx0ljlf+XwVnAp+/jBmpZtGWstBIoBQoRfKMys0PooIhDbn1 WW29U2j+P0X2/qOx2TNSjAK7b30A5/F25V2dzUz+YaISMGz8deq1QLegobUNliffA4Sj 5bQlfiYQyUmFPZgE+p0pDP7CRqCwxBUkkQ5Q4U2FxnXRwEGFdDTtOHXKEPSEfoqaqVI0 e7EWeaAyQDZoL5U1Kk6WWQNZOqET+KfdnIm8pLYV9u5RwilRNkOxynATJJGDuKWrFTPw w2kg== X-Forwarded-Encrypted: i=1; AJvYcCWEMFq3ueMzhTlxqVEl7FSUSrS2OYu7tTgA6Y+2wxU8XK/AjRP4F86oNlOXt/4YB/LOr0b8nHLgV+ktuYI=@vger.kernel.org X-Gm-Message-State: AOJu0YzJmAFZA2g4HFdsJc8U2vwaTmNlKABMvlMf8AmoP4h8Gql1pM8V 8GXy1hB9h9G6v6rFgCTafkrnsaUTTd9PAxRrZmK6PM2MA2xmVEX0AwaF+63Uk9jN4VOMezTOATd aDxsdPdq4DcZxuwHTonFmNhVpW4ybmgb2TBKpwO5je8xhnfHCM7Lq1HYOoAx7C5buyw== X-Gm-Gg: ASbGncugPvJ/G5zs3M69nGJdGTChVprDbx0+eCDnZuklSCrbeQYJHUh6WrbMaugciiu XvFucxd/KyaqlsmzWENpGufPNfnDfiwOkHUPwO057hYbo1JKQwelKhmRkdIqsvg4eoNyNa+dEJt pwsMW6O8AIwViVHdxdUR/oAyiY1jJsg+fPhxE4dZgpP8UggOiFwupbcnQbQBMDCnztF1Mk4QkZf kLL2xjELvSQZVNlCtQuvtEjuICYaK496MFRr4nl9BkVRYrxH6PzrQ3vbBAHRfy1/HySmEDPDiCY Ylzp3HkNgqowWE+8/dbBuATM6fVtuefP9y4+d5ZvX5+X1UiZMtKceYPnrACXz2ZU6IC7TeGAT/P holSHtubgY9tLKJYDTMIYDSGpC/LsSLV0EYmiB/fI+A== X-Received: by 2002:a05:6214:3286:b0:785:aa57:b5bb with SMTP id 6a1803df08f44-8863af9e4e2mr14512296d6.43.1764031595193; Mon, 24 Nov 2025 16:46:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1IIBLslO2enBnltrjevE+RfgzVlbb9qwoLOv7Ks1RpjPqjqO5ugdNzJyrbWT1YPDsV4Kegw== X-Received: by 2002:a05:6214:3286:b0:785:aa57:b5bb with SMTP id 6a1803df08f44-8863af9e4e2mr14511936d6.43.1764031594723; Mon, 24 Nov 2025 16:46:34 -0800 (PST) Received: from crwood-thinkpadp16vgen1.minnmso.csb ([2601:447:c680:2b50:ee6f:85c2:7e3e:ee98]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8846e46a4b2sm110780436d6.19.2025.11.24.16.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Nov 2025 16:46:34 -0800 (PST) Message-ID: Subject: Re: [rtla 05/13] rtla: Simplify argument parsing From: Crystal Wood To: Wander Lairson Costa , Steven Rostedt , Tomas Glozar , Ivan Pravdin , John Kacur , Costa Shulyupin , Tiezhu Yang , "open list:Real-time Linux Analysis (RTLA) tools" , open list , "open list:BPF [MISC]:Keyword:(?:\\b|_)bpf(?:\\b|_)" Date: Mon, 24 Nov 2025 18:46:33 -0600 In-Reply-To: <20251117184409.42831-6-wander@redhat.com> References: <20251117184409.42831-1-wander@redhat.com> <20251117184409.42831-6-wander@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2025-11-17 at 15:41 -0300, Wander Lairson Costa wrote: > =20 > +/* > + * extract_arg - extract argument value from option token > + * @token: option token (e.g., "file=3Dtrace.txt") > + * @opt: option name to match (e.g., "file") > + * > + * Returns pointer to argument value after "=3D" if token matches "opt= =3D", > + * otherwise returns NULL. > + */ > +#define extract_arg(token, opt) ( \ > + strlen(token) > STRING_LENGTH(opt "=3D") && \ > + !strncmp_static(token, opt "=3D") \ > + ? (token) + STRING_LENGTH(opt "=3D") : NULL ) This could be implemented as a function (albeit without the concatenation trick)... but if it must be a macro, at least encase it with ({ }) so it behaves more like a function. > + > /* > * actions_parse - add an action based on text specification > */ > int > actions_parse(struct actions *self, const char *trigger, const char *tra= cefn) > { > + > enum action_type type =3D ACTION_NONE; Why this blank line? > diff --git a/tools/tracing/rtla/src/utils.h b/tools/tracing/rtla/src/util= s.h > index 160491f5de91c..f7ff548f7fba7 100644 > --- a/tools/tracing/rtla/src/utils.h > +++ b/tools/tracing/rtla/src/utils.h > @@ -13,8 +13,18 @@ > #define MAX_NICE 20 > #define MIN_NICE -19 > =20 > -#define container_of(ptr, type, member)({ \ > - const typeof(((type *)0)->member) *__mptr =3D (ptr); \ [snip] > +#define container_of(ptr, type, member)({ \ > + const typeof(((type *)0)->member) *__mptr =3D (ptr); \ > (type *)((char *)__mptr - offsetof(type, member)) ; }) It's easier to review patches when they don't make unrelated aesthetic changes... -Crystal