Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1476834rwb; Wed, 26 Jul 2023 13:09:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlE49s4TgIDf/c1DJfX/4XEhG8eaJRULJv16mOd6BESYH1upYJlhFapHZ+d1xpttyHs25C9a X-Received: by 2002:a05:6a20:1589:b0:132:cd2d:16fd with SMTP id h9-20020a056a20158900b00132cd2d16fdmr3257417pzj.38.1690402165590; Wed, 26 Jul 2023 13:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690402165; cv=none; d=google.com; s=arc-20160816; b=R/fTtetLv+eAUzntrC9qoyCefSYvZ6G+0GQ71u1uQFZxOqXZNxhCrx3caUDIIWmfqF tj1ICKKDLRdIA+NpGOljlzOBCIeOuEdtSBiO1/yyuUsTu1ujjKYP1L9NUitMPQbmab/5 qIAzRIRO+wpHL5B4ULy5m1eP2+qdUWN/QPHj+ZXGjHwQ8eUBbSHcHUJc2bQ2+D4meLDV lzvDz8kKP/4aTMgIpnW+zHcc02UXJmiNnlGC+zRNZH293+j2kThUr+yNcO05oC5jU8MI m+Yr1quvqJ0QiuP4K7T+yKKXKxzAdJFR7VLHKfgz8+4gx8ZGUx8vxely3hlud7h/UAsB Ah7A== 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=1d7CaZpDV/78YrgFG/0uGdIQQxppheEYZxRbbWhaTp8=; fh=ssCX1sjd5qt88BaR0yRNXggTpiVPA/EDtQ2IicSMeXY=; b=w4jrv8HDaV8Vmh62bvoaMwzhsZdErDO5uDrnuGzYoeWLz+3CsDhfvA85J+m5LJpKgH h138Pg+zEGVq+02dqaPV/72OWMx5oJbrUjy6KlgdEJctnOHM2es3dV7dPQEnmMyAbC/4 kCNiqCW1+KYAHH6OBUmmdCVYFobQ6UUh/MdwE7uXhdEqRv47jyVv6Qr+NXdlYtnY5T7l fQrVEYPe5OLnf43MlvDhzilOGkJN7WFySjyguX9oIoHtFIx0/+nR86r4O1ruWE0yaB76 rizBafz0x0bjDOBJBIzTbXOsoTSdkvdehZzYTFe1eTWBzFZ0eDNHmd1mi0gL4L2YjRYN ob+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sLyIAGyV; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6379c3000000b0054fd670e85fsi13456603pgc.233.2023.07.26.13.08.51; Wed, 26 Jul 2023 13:09:25 -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=@kernel.org header.s=k20201202 header.b=sLyIAGyV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232128AbjGZTmG (ORCPT + 99 others); Wed, 26 Jul 2023 15:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230484AbjGZTmE (ORCPT ); Wed, 26 Jul 2023 15:42:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1F1B1BE3; Wed, 26 Jul 2023 12:42:03 -0700 (PDT) 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 6014861CBB; Wed, 26 Jul 2023 19:42:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0408AC433C7; Wed, 26 Jul 2023 19:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690400522; bh=6e6cReriYF7em75Hf0iAxdRhfTIt48diinTa2LCaE+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sLyIAGyV6TUHuowqKx/5JfDcmeo0WhbUg1yCQ8GAUu2bA1CHQXElka+Q1GRT7V1yv R0EddtJuV1su72lOKWDmqPZkTqr3rjqushe4n3Y0JyPwiujSaR6lzMnBE/bXB37uce 8O1V4aPEPJ7CtaWT6N1qd3sf2g3qg1GZ/ysRkHn0W2duBIi4pMtC3lDu6nsoC6Pt3/ swHIlZLsRsV+7qlwiW9MPLzwOhahR6eIG7+fvoyQ2iGsIvPP2A61lMuC8l5VN12v0v 2zw+8Jdxg6lE+m401O76ze1xAH8enmcSNQ3pjVXumpOLBXI9Yvybgks7Mc9qIvNX4N FrlfiSoNf+zHg== Date: Wed, 26 Jul 2023 12:41:48 -0700 From: Josh Poimboeuf To: Valentin Schneider Cc: 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, Steven Rostedt , 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?Q?Wei=C3=9Fschuh?= , 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: <20230726194148.4jhyqqbtn3qqqqsq@treble> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-3-vschneid@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230720163056.2564824-3-vschneid@redhat.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, 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? > + > + 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; > + -- Josh