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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97AB1C433FE for ; Thu, 11 Nov 2021 10:11:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7519661269 for ; Thu, 11 Nov 2021 10:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232611AbhKKKOA (ORCPT ); Thu, 11 Nov 2021 05:14:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26019 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbhKKKN7 (ORCPT ); Thu, 11 Nov 2021 05:13:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636625469; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0rA+4QDY7fcYCncOWJtOa/HujeNT5Vt9NxjUSIUPHvs=; b=QXVTVZPP85huloPsfDZEZ7uTJtTN6mgpd1/wdYzj8qHNiwVP5SKjIDlZT3LgRKghuYZClJ A55JK1Eunwz/NhQWUq237Jr6jyqF+jI7Y8x9rFL2HZnr0WbLHEuTVRLp7H4UvUxF1Mwc3B w1RNE77ZK2o0M1+KseOrLcEFHv+oIvg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-VGAAWkzFM9eIffJ-7_UsGA-1; Thu, 11 Nov 2021 05:11:07 -0500 X-MC-Unique: VGAAWkzFM9eIffJ-7_UsGA-1 Received: by mail-wm1-f71.google.com with SMTP id o10-20020a05600c4fca00b0033312e1ed8bso2466614wmq.2 for ; Thu, 11 Nov 2021 02:11:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=0rA+4QDY7fcYCncOWJtOa/HujeNT5Vt9NxjUSIUPHvs=; b=qHj7yUsdiYf0aal+h1PiJk0YZpROc9aGul3anTa50CTqIEumgK0LIGrgOj4M9xLXaB r9Bh2hEgUWI1UO/mHcYNYYAyCyH5+JQwbTxJ+rNrq88HKARsF3RMAv4qX7rE6uxPPxEn miinBXtSymzydqFZHC4D56EsDRbNXMKZmOdvKtUoeRUmiI4K0A2V+KIv2xa3yg8DUXRY DMwXdgjubFdlxvhzkvig7wGRa0IioI3BeeV2vAlCBS1Rvo/tPQ0PMk5165IIhH57lrXi N+d8Ge3H1BU41RdzDbjkcSNeOmtYCdN3QOh0TJ/gnyQawy96KK/xal4lfs4jJFl/TrYr kr5g== X-Gm-Message-State: AOAM531hEelE/b6keOrzwwKhXKQG+JpLhgTyBZ0fLFoqWCGD/+x78e0u XzlSoQUmCmTRe3gsyTqovupCTBK5CPuE7hiFoSE9z9qc9TtnIzhppe90Z0Bxp5GLKyy3THyzgQ+ 6YL3fOGWnE6kYc870xwerqucqiVE2Ag== X-Received: by 2002:adf:f0c5:: with SMTP id x5mr7303229wro.320.1636625466724; Thu, 11 Nov 2021 02:11:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOcg/IBIObd/PrNSThzuPmbYflfz+NcWv98QuuE6NH2tE/x226NzWn+mDBhgZ2vITILodW1Q== X-Received: by 2002:adf:f0c5:: with SMTP id x5mr7303188wro.320.1636625466497; Thu, 11 Nov 2021 02:11:06 -0800 (PST) Received: from [192.168.3.132] (p4ff23ee8.dip0.t-ipconnect.de. [79.242.62.232]) by smtp.gmail.com with ESMTPSA id t8sm2094352wmn.44.2021.11.11.02.11.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Nov 2021 02:11:06 -0800 (PST) Message-ID: <24b685c3-f16a-9ced-fb39-bf6a0b9f994e@redhat.com> Date: Thu, 11 Nov 2021 11:11:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 7/7] tools/testing/selftests/bpf: make it adopt to task comm size change Content-Language: en-US To: Yafang Shao , akpm@linux-foundation.org Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, oliver.sang@intel.com, lkp@intel.com, Andrii Nakryiko , Mathieu Desnoyers , Arnaldo Carvalho de Melo , Andrii Nakryiko , Michal Miroslaw , Peter Zijlstra , Steven Rostedt , Matthew Wilcox , Al Viro , Kees Cook , Petr Mladek References: <20211108083840.4627-1-laoar.shao@gmail.com> <20211108083840.4627-8-laoar.shao@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20211108083840.4627-8-laoar.shao@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On 08.11.21 09:38, Yafang Shao wrote: > The hard-coded 16 is used in various bpf progs. These progs get task > comm either via bpf_get_current_comm() or prctl() or > bpf_core_read_str(), all of which can work well even if the task comm size > is changed. > > In these BPF programs, one thing to be improved is the > sched:sched_switch tracepoint args. As the tracepoint args are derived > from the kernel, we'd better make it same with the kernel. So the macro > TASK_COMM_LEN is converted to type enum, then all the BPF programs can > get it through BTF. > > The BPF program which wants to use TASK_COMM_LEN should include the header > vmlinux.h. Regarding the test_stacktrace_map and test_tracepoint, as the > type defined in linux/bpf.h are also defined in vmlinux.h, so we don't > need to include linux/bpf.h again. > > Signed-off-by: Yafang Shao > Acked-by: Andrii Nakryiko > Cc: Mathieu Desnoyers > Cc: Arnaldo Carvalho de Melo > Cc: Andrii Nakryiko > Cc: Michal Miroslaw > Cc: Peter Zijlstra > Cc: Steven Rostedt > Cc: Matthew Wilcox > Cc: David Hildenbrand > Cc: Al Viro > Cc: Kees Cook > Cc: Petr Mladek Acked-by: David Hildenbrand -- Thanks, David / dhildenb