From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DD11C04FE0 for ; Sat, 29 Jul 2023 19:09:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 260608D0002; Sat, 29 Jul 2023 15:09:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2106E8D0001; Sat, 29 Jul 2023 15:09:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D9278D0002; Sat, 29 Jul 2023 15:09:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id ECFE28D0001 for ; Sat, 29 Jul 2023 15:09:11 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id C2DF4A03AF for ; Sat, 29 Jul 2023 19:09:11 +0000 (UTC) X-FDA: 81065587302.30.2FCD15D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id 18FA4C0005 for ; Sat, 29 Jul 2023 19:09:08 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.hostedemail.com: domain of "SRS0=Uptn=DP=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Uptn=DP=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690657749; h=from:from:sender: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=t6SUyxehmlX6cYjjMz3BTO1Jk/SHo1rsky8tapkU6zw=; b=yzpiw0w6Arn04IMuwFR15ZrxLWoXDVWaCAMdq/80O3rAeM11fCsXA0ZJ6pzjHqMxhD2B1I DsipWpCKVxIBDrhazrifJl/xCkmpBoMn4buEVmHvo3I9b7WGVttr5tAQRKW2l8S8ueDpf7 uhHHHfAxHu/x7V+Bxg8BtzCUaBW4c0Y= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf28.hostedemail.com: domain of "SRS0=Uptn=DP=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=Uptn=DP=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690657749; a=rsa-sha256; cv=none; b=01HZFnzF+iagjhIMFJw4qZAoV02+7YC+tiupKPcsCnNhx09DOFoFZoprzZz/0PTygZ2WjU RcaaWW6CAYKooruik1xhFrhIffnxAhSod1yQ6DbMYwpQwOvP7dzo0yaoecjOa8rVfk/OUH NFRA28cnrER/mcNI7/OWrZA3C/hh6rE= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EE13E60691; Sat, 29 Jul 2023 19:09:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E1ADC433C7; Sat, 29 Jul 2023 19:09:03 +0000 (UTC) Date: Sat, 29 Jul 2023 15:09:01 -0400 From: Steven Rostedt To: Josh Poimboeuf 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 , 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 =?UTF-8?B?V2Vpw59zY2h1aA==?= , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Yair Podemsky Subject: Re: [RFC PATCH v2 02/20] tracing/filters: Enable filtering a cpumask field by another cpumask Message-ID: <20230729150901.25b9ae0c@rorschach.local.home> In-Reply-To: <20230726194148.4jhyqqbtn3qqqqsq@treble> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-3-vschneid@redhat.com> <20230726194148.4jhyqqbtn3qqqqsq@treble> 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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 18FA4C0005 X-Stat-Signature: idrud59dqhcixnraeatttnf7kwy3oddp X-HE-Tag: 1690657748-670809 X-HE-Meta: U2FsdGVkX1+xy4J63aeOIqySUEJlJ4JtpJoqQGeAQEHgP6MUCtlv3RnL2ypCalxn6J/WM/L60h2ylZyO4FrLK0nNXCDH4K0IHXGj4CIF22LEB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dRjK+hiygItDproWaOo2IE90KZsb6Cn56qJ3ZGQ51EvVomumS9KShRUVWM0Q28rpK96+Kqpaea6I4/2ilmZnUltSVxUHoIjHIBL98gLvUOmW+mF5QnNsI79uiU1fiP0PZ2JxRx+S2+QRdPQ2XHRlo/PXB73fSpkrQhFZS7M1xvpdq8QIT81KmxI5ersME/pMH5UsnGpu28EP7HNhvghg+3NrKhG/M2GPsDmU9LnqT3FZBgLTGggU2Cupd90YKD/l1EuK4lJh2wfNHSTnx2DmhvV6H23fIemc8e X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 26 Jul 2023 12:41:48 -0700 Josh Poimboeuf wrote: > On Thu, Jul 20, 2023 at 05:30:38PM +0100, Valentin Schneider wrote: > > int filter_assign_type(const char *type) > > { > > - if (strstr(type, "__data_loc") && strstr(type, "char")) > > - return FILTER_DYN_STRING; > > + if (strstr(type, "__data_loc")) { > > + if (strstr(type, "char")) > > + return FILTER_DYN_STRING; > > + if (strstr(type, "cpumask_t")) > > + return FILTER_CPUMASK; > > + } > > The closing bracket has the wrong indentation. > > > + /* Copy the cpulist between { and } */ > > + tmp = kmalloc((i - maskstart) + 1, GFP_KERNEL); > > + strscpy(tmp, str + maskstart, (i - maskstart) + 1); > > Need to check kmalloc() failure? And also free tmp? I came to state the same thing. Also, when you do an empty for loop: for (; str[i] && str[i] != '}'; i++); Always put the semicolon on the next line, otherwise it is really easy to think that the next line is part of the for loop. That is, instead of the above, do: for (; str[i] && str[i] != '}'; i++) ; -- Steve > > > + > > + pred->mask = kzalloc(cpumask_size(), GFP_KERNEL); > > + if (!pred->mask) > > + goto err_mem; > > + > > + /* Now parse it */ > > + if (cpulist_parse(tmp, pred->mask)) { > > + parse_error(pe, FILT_ERR_INVALID_CPULIST, pos + i); > > + goto err_free; > > + } > > + > > + /* Move along */ > > + i++; > > + if (field->filter_type == FILTER_CPUMASK) > > + pred->fn_num = FILTER_PRED_FN_CPUMASK; > > + >