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 D2C5619ABAB for ; Tue, 28 Jan 2025 11:30:54 +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=1738063857; cv=none; b=pfzLp85xbTlHT57RzVcu27q24pzpPtnQkwOoLRyX3NbMTQ+zEEll9CduLWZYAtbo9PAGMlLs9D+W/S9zCL2KTSd4DUQrM9jX5bopcFqigiSXXrNJXQPZFWyh9znCaQpe2f9iru1+66gy9XUANL78hTY+bMakr1vnw90Q/hoMNvA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738063857; c=relaxed/simple; bh=tz1e5zsucBOICHQWENU+X7aKFxU/AlreRCg+gWNoNaw=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=KvBK1L+exmmIYM+iO9PqBGwyxpeYKEs55zNRwst5QIddq+BEKQG1M++WpEaTK6PkYkpCzyAdCnT/+2RsnuLpu8lptE9rAc9/kqJhk4h8FUjDqMuIngUfcKeSZu00lexHgAEtNTjkZbgQ+hi4PCM3OyMtojg2yMBxRo++J+rDUPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=BhlPsb02; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="BhlPsb02" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738063853; 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:autocrypt:autocrypt; bh=AMSF7Q3H3oy1kbJhB6KKPKHXVWwzUgKVVNuL0gZFWNo=; b=BhlPsb02BMKeZRw7cdYWF0OPPnOWktKAHj2ZDT5sP2s2KP68VEbMnNLU4K+Ey5IBIurS+i 2Ydgq8IK6ObjwKiIhvymKFXDz0RGimKhWfLiW+4BGTrNFtx0B9DVsyjTH9MHvVv39KGRZ6 TED86YPnCPm0ZvG8zKQirA4fjM7SGRM= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-614-p8yphPx0O_Khtl1RMt7zmg-1; Tue, 28 Jan 2025 06:30:52 -0500 X-MC-Unique: p8yphPx0O_Khtl1RMt7zmg-1 X-Mimecast-MFC-AGG-ID: p8yphPx0O_Khtl1RMt7zmg Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7b6e5c9ef38so1001941885a.1 for ; Tue, 28 Jan 2025 03:30:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738063852; x=1738668652; h=mime-version:user-agent:content-transfer-encoding:autocrypt :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AMSF7Q3H3oy1kbJhB6KKPKHXVWwzUgKVVNuL0gZFWNo=; b=s7yzBIvbNlmiBmW+Yc/+WMhuYFLw19ApYpuXU787LqbYBBAIQaiuQ2u3TD4j79VHBs IFPI/RkpRGw/KqZxu6Dk/Z5kbGKh6oWn9uIY/7WFCvPZps5ZPshmchB9LY8sqbobQkN/ PB+n1MLWu2grEQsGTiaGGMHDJ4F1yD8ieIUv5pz9zdRgAQdT+JboOjQdQr27ypRcGDVa QaaP+Ec0NeGsV6pFn9fgTILWuvP+XbSdJHA/O7bOnf/EiJFf4aih4VoD/Ud5mKnTV1Zl GWMWxdaZ7djKOnCrlC9nkiBb5QgjTJY/p3xPlENFa8FXr/a5vF9Uk0pz2733k86virMq 0k4Q== X-Gm-Message-State: AOJu0YxlCgLEFGCK06HriluKnGWq9EET2T4hNbdYIA+HdfH/8UHVjTT9 StAr02AvY8xMeeqFz01N3Q5zkZvBwI7rRfabXrGY42KnH7Hu+tFBuuBPHAbe2P/Sqo5H8KOKBuZ JHxitBqso5xhQB6OvfLcYuHBzf1TbCh/D9AGEyjkrNg84yla8ZKpysXMCMyRtgGY7d8sveL/HFS qV0c9+2xjEGsWbeRNZdihNH2n30aU5KN5wALzZjwNGx0HT1J0= X-Gm-Gg: ASbGncshxAEchReEebu8DKIxtwhgLOJHEhDMPeIS4kYA0BDBYYXYAppAlwdEIhcQVM5 Q4FPIIyCPNeg07Kc4Wf9ok/L9xyHGnlNAu3oNL1pOd3/JM9NuPfUAtF9dHnmvcPcKwWy2xm+5qh ge6JBusjsy4zPp4eSL7x4AHW3oQZIbhCAJl8To5MjERntNFDsprAqgPiWhQd/782ryxvec8eHbF YZZ8eNSuHULAbnOLt/JeVVHx+0sdMA2dOrh9dWfottufiXjs608uDl5KOC/TWIJoaN/nc26JhAW zjT+UzDQW/IZtRGTWIm2R+6H+oL58BM= X-Received: by 2002:a05:620a:319b:b0:7b6:ea67:72d0 with SMTP id af79cd13be357-7bff3f5f219mr482948185a.4.1738063851758; Tue, 28 Jan 2025 03:30:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHUu5ML3jjMJyodEANNFw49gg+MXot7/xL7svpr6FHhGC5kAxSib1gXRz0cyRxHNXd5oaxyw== X-Received: by 2002:a05:620a:319b:b0:7b6:ea67:72d0 with SMTP id af79cd13be357-7bff3f5f219mr482944185a.4.1738063851351; Tue, 28 Jan 2025 03:30:51 -0800 (PST) Received: from gmonaco-thinkpadt14gen3.rmtit.csb ([185.107.56.40]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7be9af11a3dsm496057785a.109.2025.01.28.03.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 03:30:51 -0800 (PST) Message-ID: <2660636b8e9d14f905b161cdf499082952bd2030.camel@redhat.com> Subject: Re: [PATCH] tracing: Fix DECLARE_TRACE_CONDITION From: Gabriele Monaco To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers Date: Tue, 28 Jan 2025 12:30:47 +0100 In-Reply-To: <20250128111926.303093-1-gmonaco@redhat.com> References: <20250128111926.303093-1-gmonaco@redhat.com> Autocrypt: addr=gmonaco@redhat.com; prefer-encrypt=mutual; keydata=mDMEZuK5YxYJKwYBBAHaRw8BAQdAmJ3dM9Sz6/Hodu33Qrf8QH2bNeNbOikqYtxWFLVm0 1a0JEdhYnJpZWxlIE1vbmFjbyA8Z21vbmFjb0ByZWRoYXQuY29tPoiZBBMWCgBBFiEEysoR+AuB3R Zwp6j270psSVh4TfIFAmbiuWMCGwMFCQWjmoAFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgk Q70psSVh4TfJzZgD/TXjnqCyqaZH/Y2w+YVbvm93WX2eqBqiVZ6VEjTuGNs8A/iPrKbzdWC7AicnK xyhmqeUWOzFx5P43S1E1dhsrLWgP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2025-01-28 at 12:19 +0100, Gabriele Monaco wrote: > Commit 287050d39026 ("tracing: Add TRACE_EVENT_CONDITIONAL()") adds > macros to define conditional trace events (TRACE_EVENT_CONDITIONAL) > and > tracepoints (DECLARE_TRACE_CONDITION), but sets up functionality for > direct use only for the former. > Any attempt to use DECLARE_TRACE_CONDITION fails the build. >=20 > Add preprocessor bits in define_trace.h to allow usage of > DECLARE_TRACE_CONDITION just like DECLARE_TRACE. >=20 > Fixes: 287050d39026 ("tracing: Add TRACE_EVENT_CONDITIONAL()") > Signed-off-by: Gabriele Monaco > --- The macro is currently never used, I'm planning to use it in a future patch. Likewise also DECLARE_TRACE_SYSCALL is never used and would fail the build if used. I'm not sure if the macro would be of use in this way, since it's missing the reg and unreg parameters used in DEFINE_TRACE_SYSCALL, one way not to fail the build is to treat it just lik= e DECLARE_TRACE (as DECLARE_TRACE_CONDITION). I can prepare this as a patch if it's the intended behaviour: diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index ed52d0506c69..497a5a2469dc 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h @@ -80,6 +80,10 @@ #define DECLARE_TRACE_CONDITION(name, proto, args, cond) \ DEFINE_TRACE(name, PARAMS(proto), PARAMS(args)) =20 +#undef DECLARE_TRACE_SYSCALL +#define DECLARE_TRACE_SYSCALL(name, proto, args, cond) \ + DEFINE_TRACE(name, PARAMS(proto), PARAMS(args)) + /* If requested, create helpers for calling these tracepoints from Rust. *= / #ifdef CREATE_RUST_TRACE_POINTS #undef DEFINE_RUST_DO_TRACE @@ -114,6 +118,8 @@ #define DECLARE_TRACE(name, proto, args) #undef DECLARE_TRACE_CONDITION #define DECLARE_TRACE_CONDITION(name, proto, args, cond) +#undef DECLARE_TRACE_SYSCALL +#define DECLARE_TRACE_SYSCALL(name, proto, args, cond) =20 #ifdef TRACEPOINTS_ENABLED #include @@ -136,6 +142,7 @@ #undef TRACE_HEADER_MULTI_READ #undef DECLARE_TRACE #undef DECLARE_TRACE_CONDITION +#undef DECLARE_TRACE_SYSCALL =20 /* Only undef what we defined in this file */ #ifdef UNDEF_TRACE_INCLUDE_FILE