From patchwork Sat Dec 11 06:39:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 12671685 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48F32C43217 for ; Sat, 11 Dec 2021 06:40:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbhLKGkF (ORCPT ); Sat, 11 Dec 2021 01:40:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbhLKGkD (ORCPT ); Sat, 11 Dec 2021 01:40:03 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38450C061714; Fri, 10 Dec 2021 22:40:03 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id gt5so8332677pjb.1; Fri, 10 Dec 2021 22:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TZV2akOfGkMYXOBRArbqbu6dxDYcT5+TVmROYOG16l0=; b=TkcDmDViXI57Xnv7ZLFQNtjrEPmhhun71oUPc9lDSvrkVqzpeqhOZtev3RPN6jjz0u N9zpX8zdcx/Osl7dswhaP8mJz7jndE8heKd0yCnPJVUgnVPlDnBsRgF3DfOYfEGQGWjK j7OjirVMTUYvgtv6+63tAOqtccuw+NpRilI57jL8hh/Fi+96GlSD5yBOG/Lehh1WCyOh ATmUaNxeO3jK62SlOJGR2sSGglUKQbrlJIXwJtlJGCMa9fTL9D/2Pcwsih+nP3ygM6QS CuSo4GuUIfvp4nYHT4rx6FW5qhvP+2jqZl1Dr45tHbNSRQlu4obh0xSpGacDXuQRQ2Lj NrxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TZV2akOfGkMYXOBRArbqbu6dxDYcT5+TVmROYOG16l0=; b=YQ7Oxs1BjIaXYa1ECTHR8NF+u+Egnb7vbFp36mzacPUA323wxaX5qMEtDNHjgJbM0f +UBFLiXZg5oGbSAavzX99tE0wC51oWbBHOzObDEGmkqxLArMQ7qI76Ode4b5eJrDynON JBKpD+t+aXi2e59XGbY6xP5mtmR02DDCDlC5eHfKRyQDSqKK6//iR/FWZG+0rkAsHGMa 8O5NUOOIkVJg/vupNjCI5fs8WODtMvxkgE5mSUW88kZmbj4yETXaCx9URcFZpZNgI0s8 MLCh1HlNCnXGeLvda8j7/1pFhLOWD1VMl0shuJVLI72hmO2RVdazZ0OnZfdhUjyzZdJH NFlg== X-Gm-Message-State: AOAM532AILrYRdM3jpKSFZVDAoRpWjya/aU6+ll/hGtWylnWSQ5BlBnn oW41qEyd+bbKwyEFy7k6Qlw= X-Google-Smtp-Source: ABdhPJxLChN+ADVPJ6LFYKtwALt6CHN+EQPy/Y/OCNbJZ9hpnCuwbpT+ooSoB6bQWw3XkomJn6HDOQ== X-Received: by 2002:a17:902:e88a:b0:141:dfde:eed7 with SMTP id w10-20020a170902e88a00b00141dfdeeed7mr81576375plg.17.1639204802767; Fri, 10 Dec 2021 22:40:02 -0800 (PST) Received: from vultr.guest ([45.76.74.237]) by smtp.gmail.com with ESMTPSA id mr2sm869638pjb.25.2021.12.10.22.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 22:40:02 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org, rostedt@goodmis.org, keescook@chromium.org, pmladek@suse.com, david@redhat.com, arnaldo.melo@gmail.com, andrii.nakryiko@gmail.com, alexei.starovoitov@gmail.com Cc: linux-mm@kvack.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao , Mathieu Desnoyers , Michal Miroslaw , Peter Zijlstra , Matthew Wilcox , Al Viro Subject: [PATCH -mm v2 1/3] elfcore: replace old hard-code 16 with TASK_COMM_LEN_16 Date: Sat, 11 Dec 2021 06:39:47 +0000 Message-Id: <20211211063949.49533-2-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211211063949.49533-1-laoar.shao@gmail.com> References: <20211211063949.49533-1-laoar.shao@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org A new macro TASK_COMM_LEN_16 is introduced for the old hard-coded 16 to make it more grepable. As explained above this marco, the difference between TASK_COMM_LEN and TASK_COMM_LEN_16 is that TASK_COMM_LEN_16 must be a fixed size 16 and can't be changed. Suggested-by: Steven Rostedt (VMware) Signed-off-by: Yafang Shao Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov 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 Reviewed-by: David Hildenbrand --- include/linux/elfcore-compat.h | 8 ++------ include/linux/elfcore.h | 9 ++------- include/linux/sched.h | 5 +++++ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/include/linux/elfcore-compat.h b/include/linux/elfcore-compat.h index 54feb64e9b5d..69fa1a728964 100644 --- a/include/linux/elfcore-compat.h +++ b/include/linux/elfcore-compat.h @@ -5,6 +5,7 @@ #include #include #include +#include /* * Make sure these layouts match the linux/elfcore.h native definitions. @@ -43,12 +44,7 @@ struct compat_elf_prpsinfo __compat_uid_t pr_uid; __compat_gid_t pr_gid; compat_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid; - /* - * The hard-coded 16 is derived from TASK_COMM_LEN, but it can't be - * changed as it is exposed to userspace. We'd better make it hard-coded - * here. - */ - char pr_fname[16]; + char pr_fname[TASK_COMM_LEN_16]; char pr_psargs[ELF_PRARGSZ]; }; diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 746e081879a5..d3bb4bd3c985 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -65,13 +65,8 @@ struct elf_prpsinfo __kernel_gid_t pr_gid; pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid; /* Lots missing */ - /* - * The hard-coded 16 is derived from TASK_COMM_LEN, but it can't be - * changed as it is exposed to userspace. We'd better make it hard-coded - * here. - */ - char pr_fname[16]; /* filename of executable */ - char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ + char pr_fname[TASK_COMM_LEN_16]; /* filename of executable */ + char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ }; static inline void elf_core_copy_regs(elf_gregset_t *elfregs, struct pt_regs *regs) diff --git a/include/linux/sched.h b/include/linux/sched.h index c79bd7ee6029..8d963a50a2a8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -279,6 +279,11 @@ struct task_group; * BPF programs. */ enum { + /* + * For the old hard-coded 16, which is exposed to userspace and can't + * be changed. + */ + TASK_COMM_LEN_16 = 16, TASK_COMM_LEN = 16, }; From patchwork Sat Dec 11 06:39:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 12671689 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 120B8C4332F for ; Sat, 11 Dec 2021 06:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbhLKGkI (ORCPT ); Sat, 11 Dec 2021 01:40:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbhLKGkF (ORCPT ); Sat, 11 Dec 2021 01:40:05 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7EA1C061714; Fri, 10 Dec 2021 22:40:04 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id v23so8298700pjr.5; Fri, 10 Dec 2021 22:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/I2CQOSPxPl3e4Yr2uDBAw9mvwLM+fXKuKYxA0ZrAYc=; b=VIOouOyVNGP8AMS7vH25R7ezTHIuVaLkOsH1g8p5QlmHTgcBJDKschh6e69WqeS5lg 1A+26/jKzb+DENoLnSfK/GkVY1ny5DfT8VcQfNhTXBj4n4Cx+tkzLOViWV04Zl2FZ+gY i56ke3Yog79crQ2m03IiInSJjf2DqTjTz/HO5dOHu33LzJmYCpsT02C2SeZRj5TBaQVQ y9aV+JJA33lbAA/0CqRqIdEnKMNrPSWeav3knE0MLSq6ln2gbFu7jRxL149TNAmm4X7Y ELabuPWamLYFojIGKpiAYr0Ef/CKj3V2RsEs/lJplEihtkM9YuMLB1w23mGqB7ZjcIfl SEKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/I2CQOSPxPl3e4Yr2uDBAw9mvwLM+fXKuKYxA0ZrAYc=; b=DtYsJeUeLLueZxJAZlA9mpxvszZP9+UajFhmCcTYAh4pLfhjPF5GDPpErkzNNkhFoW GMdfEkp5A3y/iasOa7LYkERKOOSgIkkKd7bTBjXk1MTvVnwiK/8zrsOcA9gD6Ob9LHa2 C99GyAxCzAkbek0MTHD6e0iAlR9kPuKR+iSpeoiY+AVAlduncjbT1eqqwb7zlIASreY7 jt4SOnJSN6MGbHb2SfDVbUcGLG8AIQH3/oesKP6J3MAYvmABC/4TzDdq9O0WlWM2lCcr A1QqNHFHnvpL/xm6eDrZt1C/8/k3E90q4zuooytxleHEkFJfKX9AkTQYSbwFjip7XVgv 1KxA== X-Gm-Message-State: AOAM5336zj7vVoEjQ2M0S1MXF5xElVE304eorVSw7yGdN22D3GM+zm5w PyrvMEOmqqwxtzDb4iqtoX8= X-Google-Smtp-Source: ABdhPJwawVgqpJxNH0/hvqcqPlFrrhcBZidD0MqAaYCGD9tZ+aPQrl2q+kL/z2lm1d9TKwQ7RMOMaQ== X-Received: by 2002:a17:903:11c4:b0:141:da55:6158 with SMTP id q4-20020a17090311c400b00141da556158mr81495925plh.7.1639204804265; Fri, 10 Dec 2021 22:40:04 -0800 (PST) Received: from vultr.guest ([45.76.74.237]) by smtp.gmail.com with ESMTPSA id mr2sm869638pjb.25.2021.12.10.22.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 22:40:03 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org, rostedt@goodmis.org, keescook@chromium.org, pmladek@suse.com, david@redhat.com, arnaldo.melo@gmail.com, andrii.nakryiko@gmail.com, alexei.starovoitov@gmail.com Cc: linux-mm@kvack.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao , Mathieu Desnoyers , Michal Miroslaw , Peter Zijlstra , Matthew Wilcox , Al Viro Subject: [PATCH -mm v2 2/3] cn_proc: replaced old hard-coded 16 with TASK_COMM_LEN_16 Date: Sat, 11 Dec 2021 06:39:48 +0000 Message-Id: <20211211063949.49533-3-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211211063949.49533-1-laoar.shao@gmail.com> References: <20211211063949.49533-1-laoar.shao@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This TASK_COMM_LEN_16 has the same meaning with the macro defined in linux/sched.h, but we can't include linux/sched.h in a UAPI header, so we should specifically define it in the cn_proc.h. Signed-off-by: Yafang Shao Acked-by: Steven Rostedt (VMware) Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov 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 --- include/uapi/linux/cn_proc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h index db210625cee8..6dcccaed383f 100644 --- a/include/uapi/linux/cn_proc.h +++ b/include/uapi/linux/cn_proc.h @@ -21,6 +21,8 @@ #include +#define TASK_COMM_LEN_16 16 + /* * Userspace sends this enum to register with the kernel that it is listening * for events on the connector. @@ -110,7 +112,7 @@ struct proc_event { struct comm_proc_event { __kernel_pid_t process_pid; __kernel_pid_t process_tgid; - char comm[16]; + char comm[TASK_COMM_LEN_16]; } comm; struct coredump_proc_event { From patchwork Sat Dec 11 06:39:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 12671687 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C59EFC433F5 for ; Sat, 11 Dec 2021 06:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229548AbhLKGkH (ORCPT ); Sat, 11 Dec 2021 01:40:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbhLKGkG (ORCPT ); Sat, 11 Dec 2021 01:40:06 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2CF7C061714; Fri, 10 Dec 2021 22:40:05 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so9287726pjb.1; Fri, 10 Dec 2021 22:40:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YOmWgj2DxdohruN6t1jhLzVebqIDyQ6/9OEYQxNzBg0=; b=avF8g6XTx8SXtkscJO5GafrYodx7aduWYE3dYkSVMyLazEekKe1vVFk1AcFgyRBi6D KLtMP+qE/Amw1XwaQT/yoZ7FOpLwpBIsjgKmZHipCkgkLFNTE6AqlpV1aH5qy7E7MmSl Qm6JgY75X1B3qkf/H2k7QvWLl8G9yHb61vg4+ii+LxdBRZLuOVbmTGjafvriHmt9NNf2 C2Gdtyfny7jByIehwd+AyV30ha9OKEIw3yPh05v5AvFtaFqno5FojQ8vmgGFIAbxiGEE h9szKpnk6ljwBnYCjFwml3+o+AVuPYrMIgmExUuBfP4zdOzo4zP83bUHVEc1hawnKN1j 56yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YOmWgj2DxdohruN6t1jhLzVebqIDyQ6/9OEYQxNzBg0=; b=TMVBGicERsFuIKKy+F9Yu02a1zdhH5P1TCU8I0jOAhavTMQpYxO/EDws4oM+iv+Hwk AJaLAsBmWYOkhR8jIxAWffEXa7UkDb+paYGSrLck2KHwC3Rykn2r8zOJODe6IvW/WK84 d9QE5Di+e4J/XsUnDKch9ZGiG6CRCerfFe/OPmXYuEWTRTMoiZ8PUh0zKn8Nq785AtjF XsMwzG6NR1yC236ab1znuusAA5T6GG4H+nWYE9abRtuiqfZmZz599+HIRk+OcBXglhbC yzTTldzORhwZsBviYDWOEVpOU/8jhlLFnv60AmHsrgasDxFyk+9C/ioKTSIr+Reh7AMs Ov7Q== X-Gm-Message-State: AOAM533LrE/gW5/FbmOOKEAvn9Um+xwfN1ZuZebJ6tKN+dw99tkqcoM8 caw9zWviJuO74igYWgeKSSI= X-Google-Smtp-Source: ABdhPJyBEqkEghuO8KOI7906KYxsqu3siKTh85eWa5YxoDkG4ZEkClWkFiRCnC3BaaN4x8agFkpY0w== X-Received: by 2002:a17:90b:1b45:: with SMTP id nv5mr29250796pjb.120.1639204805586; Fri, 10 Dec 2021 22:40:05 -0800 (PST) Received: from vultr.guest ([45.76.74.237]) by smtp.gmail.com with ESMTPSA id mr2sm869638pjb.25.2021.12.10.22.40.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 22:40:05 -0800 (PST) From: Yafang Shao To: akpm@linux-foundation.org, rostedt@goodmis.org, keescook@chromium.org, pmladek@suse.com, david@redhat.com, arnaldo.melo@gmail.com, andrii.nakryiko@gmail.com, alexei.starovoitov@gmail.com Cc: linux-mm@kvack.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao , Mathieu Desnoyers , Michal Miroslaw , Peter Zijlstra , Matthew Wilcox , Al Viro Subject: [PATCH -mm v2 3/3] tools/perf: replace old hard-coded 16 with TASK_COMM_LEN_16 Date: Sat, 11 Dec 2021 06:39:49 +0000 Message-Id: <20211211063949.49533-4-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211211063949.49533-1-laoar.shao@gmail.com> References: <20211211063949.49533-1-laoar.shao@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org evsel-tp-sched will verify the task comm len in sched:sched_switch and sched:sched_wakeup tracepoints. In order to make it grepable, we'd better replace the hard-coded 16 with TASK_COMM_LEN_16. Signed-off-by: Yafang Shao Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov 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 --- tools/perf/tests/evsel-tp-sched.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c index cf4da3d748c2..8be44b8e2b9c 100644 --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -5,6 +5,8 @@ #include "tests.h" #include "debug.h" +#define TASK_COMM_LEN_16 16 + static int evsel__test_field(struct evsel *evsel, const char *name, int size, bool should_be_signed) { struct tep_format_field *field = evsel__field(evsel, name); @@ -43,7 +45,7 @@ static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unuse return -1; } - if (evsel__test_field(evsel, "prev_comm", 16, false)) + if (evsel__test_field(evsel, "prev_comm", TASK_COMM_LEN_16, false)) ret = -1; if (evsel__test_field(evsel, "prev_pid", 4, true)) @@ -55,7 +57,7 @@ static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unuse if (evsel__test_field(evsel, "prev_state", sizeof(long), true)) ret = -1; - if (evsel__test_field(evsel, "next_comm", 16, false)) + if (evsel__test_field(evsel, "next_comm", TASK_COMM_LEN_16, false)) ret = -1; if (evsel__test_field(evsel, "next_pid", 4, true)) @@ -73,7 +75,7 @@ static int test__perf_evsel__tp_sched_test(struct test_suite *test __maybe_unuse return -1; } - if (evsel__test_field(evsel, "comm", 16, false)) + if (evsel__test_field(evsel, "comm", TASK_COMM_LEN_16, false)) ret = -1; if (evsel__test_field(evsel, "pid", 4, true))