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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7605EE95A96 for ; Mon, 9 Oct 2023 08:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234391AbjJIIOL (ORCPT ); Mon, 9 Oct 2023 04:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232666AbjJIIOJ (ORCPT ); Mon, 9 Oct 2023 04:14:09 -0400 Received: from out-198.mta0.migadu.com (out-198.mta0.migadu.com [IPv6:2001:41d0:1004:224b::c6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23C57B6 for ; Mon, 9 Oct 2023 01:14:07 -0700 (PDT) Message-ID: <508b33f7-3dc0-4536-21f6-4a5e7ade2b5c@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696839245; 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=k+Qv4mm4LfFHvIi8wP7qIt9+6u91CDBoXpMXVpFXU9E=; b=reALlG5TnFKsumjcpqldLudAXAQgvY+Wrj9WQqyM/WC5hwXbSczKE0OnKNCpzd7x9qltXi XuhawL1h2RzrmHgPEFeArKJUMFD8DeJnj8qCDpEeialpgVCmY8GIVI7yYTDGbf6JpuJsjB R42q6s1hVFZ2uQMxL2EwAdno4501v6Y= Date: Mon, 9 Oct 2023 16:13:54 +0800 MIME-Version: 1.0 Subject: Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc() Content-Language: en-US To: Eric Dumazet Cc: rostedt@goodmis.org, mhiramat@kernel.org, dennis@kernel.org, tj@kernel.org, cl@linux.com, mark.rutland@arm.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Lobakin , linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org References: <20231007050621.1706331-1-yajun.deng@linux.dev> <917708b5-cb86-f233-e878-9233c4e6c707@linux.dev> <9f4fb613-d63f-9b86-fe92-11bf4dfb7275@linux.dev> <4a747fda-2bb9-4231-66d6-31306184eec2@linux.dev> <814b5598-5284-9558-8f56-12a6f7a67187@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/10/9 15:53, Eric Dumazet wrote: > On Mon, Oct 9, 2023 at 5:07 AM Yajun Deng wrote: > >> 'this_cpu_read + this_cpu_write' and 'pr_info + this_cpu_inc' will make >> the trace work well. >> >> They all have 'pop' instructions in them. This may be the key to making >> the trace work well. >> >> Hi all, >> >> I need your help on percpu and ftrace. >> > I do not think you made sure netdev_core_stats_inc() was never inlined. > > Adding more code in it is simply changing how the compiler decides to > inline or not. Yes, you are right. It needs to add the 'noinline' prefix. The disassembly code will have 'pop' instruction. Thanks.