Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4714076rwb; Mon, 31 Jul 2023 10:59:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlGDDyqQ3I7ulvBcq3lZwLNfZwX75j6gYwm9lI0AA3n/p3Pyw3JBdhMm8VBJUXYv5Vc6+kTg X-Received: by 2002:a17:902:ab96:b0:1bb:9675:8c06 with SMTP id f22-20020a170902ab9600b001bb96758c06mr8107355plr.35.1690826383300; Mon, 31 Jul 2023 10:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690826383; cv=none; d=google.com; s=arc-20160816; b=GW4TQcXJiEyGGyjLf1P+eSiA+I07Y0SxqFkEMNHPpaOwdJTz+yXUNh/6OAOxevGcEc V8OGqQnicxOc64wE07FXnOKgPwsDGN58vw4gJvJLGWO054NW61upWiNIzoiGuRTQPMaY KRO6cEFhQXpr2eIpjBv1CdmxdaQcmZr0PKFr2mQibe1QxyO1WcIS6w9DeASO9cEOC0GX 9z69jN/YMX6nh5SZ2S+dd2IJhLA3SqzOoLUXFPXw7XaXem2GVA7aApOC6Uxw+QfnicU1 l/YcngSnyTflxP3e58DlmpXZIBogOGlwtu7/M2XzDH/wZes1JFlQcCmxExPonauubHXh vZwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wjX9vqrNZsVo8pAJHyJfBfDqvLmz9Q9LwcwZTP61/cs=; fh=hacBTkuwh8JJjY82eG/jzoQO0gXVnilNT2aQYsjdDYM=; b=iFDj8UwEhuf/jEiAHpqq6SweGbE2j4VOrsKDGOnG4BT8DwECFpqV02W7Y4PQ9cuK/H Oup70Dwv78rnDLs5fOt8XU+4dNrj6tCmRymG0Evpf+zzzR+ne+4ENpaxuE0Odu2DkZO2 qo07QhYELCQ/idI/NjyGacE6j2m39H8oiriODeyQ2U5YI+TM9Io3WqLLiRUF4YKzIwuz U3wURwfzpgVuc3+3cz2olvJNv+OG7f7gujXwvXLQAZ5so+9pBrmJi4a5sw4FTJpEJlUo qXmYu7wnZvWChEmmp9QGnpDfSFj0EhpQ2bJkFBlWLXTXumwWXmo5YSIQIoJFlMxtu+7c Jhaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kYzWRu4k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r19-20020a170903411300b001bba73ddf5bsi3878901pld.566.2023.07.31.10.59.31; Mon, 31 Jul 2023 10:59:43 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=kYzWRu4k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbjGaQDj (ORCPT + 99 others); Mon, 31 Jul 2023 12:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbjGaQDS (ORCPT ); Mon, 31 Jul 2023 12:03:18 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5DCD1BF for ; Mon, 31 Jul 2023 09:03:15 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fc0aecf15bso52251735e9.1 for ; Mon, 31 Jul 2023 09:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690819394; x=1691424194; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=wjX9vqrNZsVo8pAJHyJfBfDqvLmz9Q9LwcwZTP61/cs=; b=kYzWRu4k1QcGoE6XKlByF3TqlwnnuXUy4dR/Gmke34HiIojnc6bDt5mnmDrOMIanBC QUevvvfek0A0kIhfRLCo8R/86BFpovIiHnnInbzwZivWg2DRSm+X5e15n19MoM8ITjcG /+J6EfoaBtyNvPh2Yg2/K4Zf7rrxdQB0bQhvIF9F1h5QqrkpNHuKfSzod4rrLRa1ifOB nEUhBA9+KaGfeeecCMie9MebsjXRqYzaUgOSq09dmjhabu7gzNjGo+iXkB9N7h9h4gTU J2wpszV9xtd4d81pKysjcOiYL/WmjuQhdAci9fviFugAru1L92cwlrTrGrXfizKWktqj yppQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690819394; x=1691424194; h=in-reply-to: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=wjX9vqrNZsVo8pAJHyJfBfDqvLmz9Q9LwcwZTP61/cs=; b=XbhKiEnn+fEbYhRx1oJwggA3lw9MZiup0yn6Fgf69GOlTWum2Jc2GEg74OXV6/kWhZ 6a0G62L+CD6TAobyPcWwVUcAKGWMms6/mZm56brblEqu1kKPeuAZiI0YBXi/dQvotAfj 73YEYiPAOCz6rwwSj/pDCyYxmlfbsVZR7CCVe8EKIcsEla6jSKjZuFmjIK6n4fX6C23g r+r+cnTLgBFEqnqhhq6ZjJiKxQiz5A7StTyfD6xpiVvgUuLd8z6dhaTYB4gmApO34SMn L637pHpQTafU8jIglK0Qyt8KT7z1ek/EE7lHqT4PEuArXK3ssECdIwGxtN1v+cPhZDyy IUxA== X-Gm-Message-State: ABy/qLYa1oX+z2WwAsJFT9nDRx6ZKnTE4i2Y2/qzBLaS3pfwb832MSNT ZA3POUnsKOdBP/szoKycMieTNw== X-Received: by 2002:a1c:7505:0:b0:3fc:2e8:ea8b with SMTP id o5-20020a1c7505000000b003fc02e8ea8bmr295454wmc.28.1690819394291; Mon, 31 Jul 2023 09:03:14 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id v18-20020a05600c215200b003fe0bb31a6asm8872643wml.43.2023.07.31.09.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 09:03:13 -0700 (PDT) Date: Mon, 31 Jul 2023 19:03:04 +0300 From: Dan Carpenter To: Steven Rostedt Cc: Valentin Schneider , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, x86@kernel.org, rcu@vger.kernel.org, linux-kselftest@vger.kernel.org, Masami Hiramatsu , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Paolo Bonzini , Wanpeng Li , Vitaly Kuznetsov , Andy Lutomirski , Peter Zijlstra , Frederic Weisbecker , "Paul E. McKenney" , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , Josh Poimboeuf , Jason Baron , Kees Cook , Sami Tolvanen , Ard Biesheuvel , Nicholas Piggin , Juerg Haefliger , Nicolas Saenz Julienne , "Kirill A. Shutemov" , Nadav Amit , Dan Carpenter , Chuang Wang , Yang Jihong , Petr Mladek , "Jason A. Donenfeld" , Song Liu , Julian Pidancet , Tom Lendacky , Dionna Glaze , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 06/20] tracing/filters: Optimise scalar vs cpumask filtering when the user mask is a single CPU Message-ID: References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-7-vschneid@redhat.com> <20230729155547.35719a1f@rorschach.local.home> <04f20e58-6b24-4f44-94e2-0d12324a30e4@kadam.mountain> <20230731115453.395d20c6@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731115453.395d20c6@gandalf.local.home> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, Jul 31, 2023 at 11:54:53AM -0400, Steven Rostedt wrote: > On Mon, 31 Jul 2023 15:07:52 +0300 > Dan Carpenter wrote: > > > On Sat, Jul 29, 2023 at 03:55:47PM -0400, Steven Rostedt wrote: > > > > @@ -1761,6 +1761,11 @@ static int parse_pred(const char *str, void *data, > > > > FILTER_PRED_FN_CPUMASK; > > > > } else if (field->filter_type == FILTER_CPU) { > > > > pred->fn_num = FILTER_PRED_FN_CPU_CPUMASK; > > > > + } else if (single) { > > > > + pred->op = pred->op == OP_BAND ? OP_EQ : pred->op; > > > > > > Nit, the above can be written as: > > > > > > pred->op = pret->op != OP_BAND ? : OP_EQ; > > > > > > > Heh. Those are not equivalent. The right way to write this is: > > You mean because of my typo? No, I hadn't seen the s/pred/pret/ typo. Your code does: if (pred->op != OP_BAND) pred->op = true; else pred->op OP_EQ; Realy we should probably trigger a static checker warning any time someone does a compare operations as part of a "x = comparison ?: bar; Years ago, someone asked me to do that with regards to error codes like: return ret < 0 ?: -EINVAL; but I don't remember the results. regards, dan carpenter