Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp772459pxb; Mon, 25 Oct 2021 18:38:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGsJdsMHKUUUmcZJScME/udijIcMGyV4iDyvSItxLl4o1aqSn1UDXf0/si/j8auNZG4F5l X-Received: by 2002:a17:906:338a:: with SMTP id v10mr19046280eja.524.1635212294932; Mon, 25 Oct 2021 18:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635212294; cv=none; d=google.com; s=arc-20160816; b=Q5Dl2JHfLUDMUa076lvs72cAHKlMxNI7z6oLg/vyzfMSjnlsJJjXRVnuFdNmm4dkbl L6ZUmyY83zGo7+3r9URkhmR9v5cnckNlNrz23/mPki90zjkwWFPw8aKXoJ8sAaEKEPw5 M0ENnop7Sns8VjWBUOZb+vdT/LAG4AR+RILaTxlrUGpThYJE4B6v+JOXeALy2F9RhWaO 7cINiDIY20DI1jrF480ugOfomlk9qEJDcFCjiwciMPgAv0bvb7dbNAroq51xYt4HCW9z +SIcFAsSfcgFjHmJ84LCcm0Uj3tSttccolVJG7QoA0WJlh42fhmrY0n6vhAl4ALAzQFz zEJA== 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=Dg+3da77xCN0ept3lU6Adg5MAj44I6g+k6oh+Yv/Wmk=; b=lTV1TsJdsgj+BVRvcKtXJVGbL2D0eNdhpIInsV9RzZ2/eZy3ZD51l+N28pcju1Oosz rws5GNQT7Dj8uujX+bEGjHSW1NxiuoJI0GiS6QqFu1bbNKKBu5kZGVovOZT4zx9q5xTD DGKjRBV4NE9EE1hbMFqaNGE/6BKUkyiVfcwTLM8YCLinLLb31EQ1C2t1w4TWTl5dS1lJ hhqgF5ppESq7n4UYSuZQQ2NLrdYCfN2Iy8AQjoYEAJIvXapWrKW/AxjWWqfuFE0zqCxD wOV+u+brD6SrmHJZ2NelGO2ZB8GNh3XgPEBuunf+KsViglTT2P3qY5l7daWZngnRAKAY F8rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZZAE5vvB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt11si18726334ejc.393.2021.10.25.18.37.51; Mon, 25 Oct 2021 18:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZZAE5vvB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232068AbhJYVXw (ORCPT + 99 others); Mon, 25 Oct 2021 17:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232649AbhJYVXu (ORCPT ); Mon, 25 Oct 2021 17:23:50 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB09C061224 for ; Mon, 25 Oct 2021 14:21:27 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id h193so11958420pgc.1 for ; Mon, 25 Oct 2021 14:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Dg+3da77xCN0ept3lU6Adg5MAj44I6g+k6oh+Yv/Wmk=; b=ZZAE5vvBlXBqmnqPeVDMpzNlRMG4f8aUTMM11B3Wt0yaKexrHt55FQmO5u1fD7bidR 02xhl5QvTcmR3cGt0oq36GHl7u+9soV9E6KhT6dXaK6gGrqfTsgCADyJ2v6e5SSMny1K kHJTuEDYeo3h4PCPdtNNG1VGr+EIBO7xWhzuo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Dg+3da77xCN0ept3lU6Adg5MAj44I6g+k6oh+Yv/Wmk=; b=FfWZCJE3Ueorh4sk4f1el4P4My5oSD5GRD4Y0HDKFSyXHDfPsSR21WLQ7TNSqgCFBm zy1WlcIAY6x/f8X2srmoYYFZTp4UJxC5Imww3+AG8ChF3UQ0Tu7PMC8aWa6voADgZ3DD N8LjqAavFFvbA9f+mJqto8zKmOaB0yHBLlNcCGArj6+pDnIZdh4dT9I3KhzEAvrFbpju pn+Zb/rRru8LVoXlgPoZ0amoujsP9qEOa2APiFM+E4nz/Y4h+FGs4szgBbEq8Mkqa9pN qnPWuvkv2WUJDPCLtvAtR7HcN69L8QHKm6jdc8tPyzSYTaX4Z29pnKHvFacvISeF89WK 4Qww== X-Gm-Message-State: AOAM533VoqVF5gcxdVh8su4iTM4oJBf2vihe/s6tVNb3kE1CHnFNzIwn EhHekj5AhuBfc/gfzPjbWOYIeg== X-Received: by 2002:a63:7c52:: with SMTP id l18mr9384968pgn.112.1635196887256; Mon, 25 Oct 2021 14:21:27 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j3sm20621719pfu.218.2021.10.25.14.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 14:21:26 -0700 (PDT) Date: Mon, 25 Oct 2021 14:21:26 -0700 From: Kees Cook To: Yafang Shao Cc: akpm@linux-foundation.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, arnaldo.melo@gmail.com, pmladek@suse.com, peterz@infradead.org, viro@zeniv.linux.org.uk, valentin.schneider@arm.com, qiang.zhang@windriver.com, robdclark@chromium.org, christian@brauner.io, dietmar.eggemann@arm.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, dennis.dalessandro@cornelisnetworks.com, mike.marciniszyn@cornelisnetworks.com, dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org, 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 Subject: Re: [PATCH v6 07/12] samples/bpf/offwaketime_kern: make sched_switch tracepoint args adopt to comm size change Message-ID: <202110251421.0CD56F8@keescook> References: <20211025083315.4752-1-laoar.shao@gmail.com> <20211025083315.4752-8-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211025083315.4752-8-laoar.shao@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 08:33:10AM +0000, Yafang Shao wrote: > The sched:sched_switch tracepoint is derived from kernel, we should make > its args compitable with the kernel. > > Signed-off-by: Yafang Shao > Cc: Mathieu Desnoyers > Cc: Arnaldo Carvalho de Melo > Cc: Andrii Nakryiko > Cc: Peter Zijlstra > Cc: Steven Rostedt > Cc: Al Viro > Cc: Kees Cook > Cc: Petr Mladek > --- > samples/bpf/offwaketime_kern.c | 4 ++-- Seems this should be merged with the prior bpf samples patch? -Kees > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/samples/bpf/offwaketime_kern.c b/samples/bpf/offwaketime_kern.c > index 4866afd054da..eb4d94742e6b 100644 > --- a/samples/bpf/offwaketime_kern.c > +++ b/samples/bpf/offwaketime_kern.c > @@ -113,11 +113,11 @@ static inline int update_counts(void *ctx, u32 pid, u64 delta) > /* taken from /sys/kernel/debug/tracing/events/sched/sched_switch/format */ > struct sched_switch_args { > unsigned long long pad; > - char prev_comm[16]; > + char prev_comm[TASK_COMM_LEN]; > int prev_pid; > int prev_prio; > long long prev_state; > - char next_comm[16]; > + char next_comm[TASK_COMM_LEN]; > int next_pid; > int next_prio; > }; > -- > 2.17.1 > -- Kees Cook