Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1643321rwb; Thu, 1 Dec 2022 22:03:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7uv9QzuVEQfrrUZjLijTzJpk0eg2RvGZ8nX7diO2A/lHYmDarG1u05Wv0iXf3uSLjjeqcb X-Received: by 2002:a17:90a:77cc:b0:219:1747:f19c with SMTP id e12-20020a17090a77cc00b002191747f19cmr32648510pjs.222.1669960994314; Thu, 01 Dec 2022 22:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669960994; cv=none; d=google.com; s=arc-20160816; b=NTj0E1ZpADvIXd6usWwrBJcQBAuLxqzRExcwTR/eS+PVYtUqZ277TN0mvtJZI5LqB8 nk45W35rL97rjxD0e3PU9NuruUpmJzYwfqXnYXbkZ4isCoR1YzEfV60oChf/TVa7Gdut yBBhE3ufpcxY7YUlYElFT6yqstj/c2R8HN0my3uhPHC6C05syxDM+gREvT7vCD35QlAe PzooEen0a9QqEBQ+L7OZ38+CdMiPEldV9KVG2wYhyR9QLKeEXaKVSeKdzkgdvJTJkmDC 9V1WAV+HlC0h3LworrZCu6EFlSIq1TpE9P9LLy1rXp9VaPIC7E+C9avBE+YgzihdMpOS 24iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=qhKLtQhwItcnAu78oU5MFRiUiEAE6Nq4TGD9MyC2Eus=; b=qP0H7NsnokpkRMEmr3UPssFKbbJ8MyTWbaU6T8y17UHwlnC+StEP/nmJBEI4mHgvwq PExb2nh7TAPHKCfMYQEHBh63euKtWfCUmm2vbd6pHsoGK5DAfD7NE5zZaKd29qsVFa96 G+uWF5HR6YEMj4D9oAr2ggAkMkLAWXmyh4QgdE2gfX9JchUFt1cM/7jYNlk4jkshi8r5 DY+7XXw7yz5dCpobBO3DfgUdoNFkQwzmGl/Q1au2+FDy8ciGAKP8ZssdVoHNa7rFukZx Qsu1kdwjGcB/hkE8di94ivtqH1BKReptgORfzAh1xDz1V5+OghxTFMHM0O36FaBea8+C F7LA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a17090ad24400b00218cacee1besi9209328pjw.153.2022.12.01.22.03.01; Thu, 01 Dec 2022 22:03:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231449AbiLBFBR (ORCPT + 81 others); Fri, 2 Dec 2022 00:01:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232182AbiLBFBL (ORCPT ); Fri, 2 Dec 2022 00:01:11 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D097CAFBE; Thu, 1 Dec 2022 21:01:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D9870B820F0; Fri, 2 Dec 2022 05:01:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FC16C433D7; Fri, 2 Dec 2022 05:01:02 +0000 (UTC) Date: Fri, 2 Dec 2022 00:00:59 -0500 From: Steven Rostedt To: Ira Weiny Cc: Dan Williams , Alison Schofield , Vishal Verma , "Ben Widawsky" , Jonathan Cameron , Davidlohr Bueso , "Dave Jiang" , , Subject: Re: [PATCH V2 02/11] cxl/mem: Implement Get Event Records command Message-ID: <20221202000059.50d4961e@gandalf.local.home> In-Reply-To: <20221201234052.35e5a001@gandalf.local.home> References: <20221201002719.2596558-1-ira.weiny@intel.com> <20221201002719.2596558-3-ira.weiny@intel.com> <20221201123849.0f7802ce@gandalf.local.home> <20221201234052.35e5a001@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 1 Dec 2022 23:40:52 -0500 Steven Rostedt wrote: > +#undef __print_symbolic > +#define __print_symbolic(value, symbol_array...) \ > + ({ \ > + static const struct trace_print_flags symbols[] = \ > + { symbol_array, { -1, NULL }}; \ > + __print_symbolic_str(value, symbols); \ > + }) > + > #endif /* CREATE_TRACE_POINTS */ Bah, I want this outside that #ifdef > diff --git a/include/trace/stages/stage7_class_define.h b/include/trace/stages/stage7_class_define.h > index 8a7ec24c246d..6fe83397f65d 100644 > --- a/include/trace/stages/stage7_class_define.h > +++ b/include/trace/stages/stage7_class_define.h > @@ -6,7 +6,6 @@ I also don't think I need to touch stage7. New patch: diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 00723935dcc7..9d665f634614 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h @@ -133,3 +133,24 @@ #define CREATE_TRACE_POINTS #endif /* CREATE_TRACE_POINTS */ + +#ifndef __DEFINE_PRINT_SYMBOLIC_STR +#define __DEFINE_PRINT_SYMBOLIC_STR +static inline const char * +__print_symbolic_str(int type, struct trace_print_flags *symbols) +{ + for (; symbols->name != NULL; symbols++) { + if (type == symbols->mask) + return symbols->name; + } + return ""; +} +#endif + +#undef __print_symbolic +#define __print_symbolic(value, symbol_array...) \ + ({ \ + static const struct trace_print_flags symbols[] = \ + { symbol_array, { -1, NULL }}; \ + __print_symbolic_str(value, symbols); \ + })