[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200908015020.GA56680@linux.alibaba.com>
Date: Tue, 8 Sep 2020 09:50:20 +0800
From: "dust.li" <dust.li@...ux.alibaba.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Satoru Moriya <satoru.moriya@....com>, netdev@...r.kernel.org
Subject: Re: [PATCH] net: tracepoint: fix print wrong sysctl_mem value
On Mon, Sep 07, 2020 at 10:50:30AM -0700, Jakub Kicinski wrote:
>On Mon, 7 Sep 2020 22:47:57 +0800 Dust Li wrote:
>> sysctl_mem is an point, and tracepoint entry do not support
>> been visited like an array. Use 3 long type to get sysctl_mem
>> instead.
>>
>> tracpoint output with and without this fix:
>> - without fix:
>> 28821.074 sock:sock_exceed_buf_limit:proto:UDP
>> sysctl_mem=-1741233440,19,322156906942464 allocated=19 sysctl_rmem=4096
>> rmem_alloc=75008 sysctl_wmem=4096 wmem_alloc=1 wmem_queued=0
>> kind=SK_MEM_RECV
>>
>> - with fix:
>> 2126.136 sock:sock_exceed_buf_limit:proto:UDP
>> sysctl_mem=18,122845,184266 allocated=19 sysctl_rmem=4096
>> rmem_alloc=73728 sysctl_wmem=4096 wmem_alloc=1 wmem_queued=0
>> kind=SK_MEM_RECV
>>
>> Fixes: 3847ce32aea9fdf ("core: add tracepoints for queueing skb to rcvbuf")
>> Signed-off-by: Dust Li <dust.li@...ux.alibaba.com>
>> ---
>> include/trace/events/sock.h | 14 +++++++++-----
>> 1 file changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
>> index a966d4b5ab37..9118dd2353b7 100644
>> --- a/include/trace/events/sock.h
>> +++ b/include/trace/events/sock.h
>> @@ -98,7 +98,9 @@ TRACE_EVENT(sock_exceed_buf_limit,
>>
>> TP_STRUCT__entry(
>> __array(char, name, 32)
>> - __field(long *, sysctl_mem)
>> + __field(long, sysctl_mem0)
>> + __field(long, sysctl_mem1)
>> + __field(long, sysctl_mem2)
>
>Why not make it an __array() ?
Yeah, it's better using an __array(), I will send a v2.
Thanks !
>
>> __field(long, allocated)
>> __field(int, sysctl_rmem)
>> __field(int, rmem_alloc)
Powered by blists - more mailing lists