Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2199249rwb; Thu, 27 Jul 2023 03:50:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlEeqgqgoJGFopw3Y9CH5NH0W/ZMDevgAhE5O+jdVW6VdjvtrYpJuu96kalA+ZnI5bfo21x3 X-Received: by 2002:a17:906:51ca:b0:992:ef60:ab0d with SMTP id v10-20020a17090651ca00b00992ef60ab0dmr1687210ejk.69.1690455051306; Thu, 27 Jul 2023 03:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690455051; cv=none; d=google.com; s=arc-20160816; b=aivnZvL9ENSpXCrWlu5sgsR1f80rPhGtMsxSY/oAD2D4qevmyzvOVQvY7Iuu+FOjj9 yMBb41hGjP9revXa0smWT8TK+skKhQREtsXwNIK2dBUYPDgnFpFhtk+JDBYkH4nfpFBE hXO/OecFUnk3d4Cs/8mcLj7Cwcrrl4BhgJm/AfzCQvQuriMYkEnpZc9Ncfj8injNU4Ia RS7x5cUOUF42mkUTjisMfodRHGu4/feweIVZRFRelldpQIZGcaErWtolU8QvNc9kMPmb veJDoYvTgk6GTnZ5jtyqBohJzNAhCOtiUa7DWLg4UL60XfpYgEskbAOWH/dNqCzekmM0 /3MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=9/ZtPwamYEdAIqsg4Eha/G0ZWoXDeFDSv2EcRY5ZelM=; fh=njL7NvZcAZQImptUs0hA6r6GDCOxMTZIvT1ay5z8nQM=; b=otKU8tbZGKQ6pp9TCL2Uy7IQPg9d14xB8lS+/EJ+4uJJGv8QYwnTGHTHLkp3DtukX2 LxVROpAapf2PsO5dyAHk43AzQ0EudcDmkC285emPOrfFZ7bfFXzZnsMmeYHrf9bZdLQ0 FhBH1KWV1AUnaCTHP78oxMBoKCmukd1HPJE+fMR0WEeobul2o7CdVycuoITMoLrQhAS6 krR6afzccQIMMrq2MEcLcIhi33DkYApZ+qoZcn5aEi5aFqg75LBa7R6OB08yFrTMDBVj C83mK6dUY4tu9uif2Jf7aVLbev1Mdvn88pui+lldkxfo3sle9GSnUK9HsbwkpyxFlu/i eDyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WBxm/GIC"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cf15-20020a170906b2cf00b009930ef7f05dsi880276ejb.908.2023.07.27.03.50.26; Thu, 27 Jul 2023 03:50:51 -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=@redhat.com header.s=mimecast20190719 header.b="WBxm/GIC"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234139AbjG0Jso (ORCPT + 99 others); Thu, 27 Jul 2023 05:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234028AbjG0Jra (ORCPT ); Thu, 27 Jul 2023 05:47:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD4B1B6 for ; Thu, 27 Jul 2023 02:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690451200; 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: in-reply-to:in-reply-to:references:references; bh=9/ZtPwamYEdAIqsg4Eha/G0ZWoXDeFDSv2EcRY5ZelM=; b=WBxm/GICrULU9Q4b5gRPGiWaJjiSO1esm0u94/+8NL7GaArA5pJSOWpL8V3521BemGZode liAjk7xCACW6h+HbwIIQcDRuR7LYXaaK5pow8N0tixopgJBJvyyJToUHeukCNT5x3LZBpc er8qwCcesThVPTzarY9yCwSUHEy3HVI= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615--VYhOQanNpOc6HygHIlujQ-1; Thu, 27 Jul 2023 05:46:38 -0400 X-MC-Unique: -VYhOQanNpOc6HygHIlujQ-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-4fbcdca9082so671289e87.3 for ; Thu, 27 Jul 2023 02:46:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690451197; x=1691055997; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9/ZtPwamYEdAIqsg4Eha/G0ZWoXDeFDSv2EcRY5ZelM=; b=O6aRaIQqECRsVuAc1C1NRuJ6M3yAhZntaJVmbWuevTByM0zAT0bixfOngmISCOUf5W E6MW8E7gEmcHnrg3lI4e9xTTu82x1iVQP7SO1iX2VJiIUJAc04hpLOaTTWPTGVtW/Cnx nulgBa/IE9Xios/LccfzA0HWVFhA/ISmny+ESQRWBduBe9zdvXlWeqYuDzkanOdY5awk xiSAlXSfqMF8Z28BJ/svUoloH9iUPCDmOYnuwZ3bTnydIKOnA/MbGQZQyaMJP6Bx0lGq i3bld0iGJHpVreRYN4n21eBe2RGSToyDSbLrK9j81B5XAZ8hgvd09xPuuKK2r1ZhnpWG TOQg== X-Gm-Message-State: ABy/qLbvGpPAA9gDz1YLRVlJgRUlm911qy6gQnFFdPo7Q7PvDknrKUvd HD30tZuR9lFEJmmjT81KuA9Ckvam+DW1AABcyznpsiEysaLRFovszOhEWpT/Ce1KX2CW43bh2qf TxM6P29VCt4P/4ygMSD8FkqMW X-Received: by 2002:a05:6512:3186:b0:4f8:7513:8cb0 with SMTP id i6-20020a056512318600b004f875138cb0mr1763706lfe.2.1690451196894; Thu, 27 Jul 2023 02:46:36 -0700 (PDT) X-Received: by 2002:a05:6512:3186:b0:4f8:7513:8cb0 with SMTP id i6-20020a056512318600b004f875138cb0mr1763631lfe.2.1690451196504; Thu, 27 Jul 2023 02:46:36 -0700 (PDT) Received: from vschneid.remote.csb ([149.12.7.81]) by smtp.gmail.com with ESMTPSA id l10-20020a05600c1d0a00b003fd2d3462fcsm6308442wms.1.2023.07.27.02.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 02:46:36 -0700 (PDT) From: Valentin Schneider To: Josh Poimboeuf 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 In-Reply-To: <20230726194148.4jhyqqbtn3qqqqsq@treble> References: <20230720163056.2564824-1-vschneid@redhat.com> <20230720163056.2564824-3-vschneid@redhat.com> <20230726194148.4jhyqqbtn3qqqqsq@treble> Date: Thu, 27 Jul 2023 10:46:33 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 26/07/23 12:41, 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? > Heh, indeed, shoddy that :-) Thanks! >> + >> + 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