Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5575549rwl; Tue, 21 Mar 2023 22:14:14 -0700 (PDT) X-Google-Smtp-Source: AK7set85TdPxiIDrk55c1wB196QWFJfBooh4sB1ppzvjCVi0ydJVxl4JmhU20n4bv4I6XLLHUW/R X-Received: by 2002:a05:6a20:7aaf:b0:d3:9c13:606 with SMTP id u47-20020a056a207aaf00b000d39c130606mr4548949pzh.47.1679462054628; Tue, 21 Mar 2023 22:14:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679462054; cv=none; d=google.com; s=arc-20160816; b=UlYoZ7yqNk3QJkOCIYpvQHTyaSnfw6AWCiiUPs3gLeETvD/w69hbWz/uiazxcZIL8G fxsqSLfAOsl0ri+z9W/hqwUpjSFIgb+wuNGbX+esN0yB4kbrXBOjSSpx5VYszYQXOrif RdRga0COeRjSSEG2eX85O7iDKUTrecVWCzD7DtTzm+G1ifzGcVbP4mbH9cBNVuZNVI7O 7/KpuG2syVWNcClgvdu/wHY9OcOvJQ6j1XkXE2JKLNMxp/VmQJzxQ1sTTco9/TP7X3wu HQQLA4PPC9QPew9kIbFjGI1uAL2u1im9CuG7PL21l5upkSOpsfFhHJHJe4cl4o7GD9Ky 3PKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=dJp/xvqMgKo6MHNhGO6uTpyCaW2Zg0tv2hSbJ5AAAVA=; b=fsI2BEZcKI8qAgBWdP8NZpKhu4zJJsldiJfOckq2K8KdvFt3VeLX6/F+2zS+Qva/qS J+MIMxPn8bzofwuuqWoY56F5GLoI4DEzEIJc5DYFds2GhVJKg67uZPCJf1ytpbZfRIpz WP2HYlfIZGCGQNAvtVaDI8ho5fHmL+Ng5CtPqMDDWOli3BKTHMXCWJZ1kZmt2IcrWjhZ VklfFDdz0oc2CipvNhzC6he9dcmA33L5XY5B9mEZLOg+sGKrDZSiuqN2gczo/c1trKAr DVS3iK6Q7FlPDUq9kPZ3L/eRrf/5euRuO4DeeEDADvw2WrUft0uMw9BNAD/XKYDXrioP sNjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bn22-20020a056a00325600b005d1442319d3si14331856pfb.308.2023.03.21.22.14.03; Tue, 21 Mar 2023 22:14:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sangfor.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbjCVFBV (ORCPT + 99 others); Wed, 22 Mar 2023 01:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjCVFBU (ORCPT ); Wed, 22 Mar 2023 01:01:20 -0400 Received: from mail-m118111.qiye.163.com (mail-m118111.qiye.163.com [115.236.118.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F313F3B862; Tue, 21 Mar 2023 22:01:17 -0700 (PDT) Received: from [10.128.10.193] (unknown [117.133.56.22]) by mail-m118111.qiye.163.com (Hmail) with ESMTPA id 9A1045802E1; Wed, 22 Mar 2023 13:01:09 +0800 (CST) Message-ID: <463601ac-da5f-1616-e531-2bbc3a22fc43@sangfor.com.cn> Date: Wed, 22 Mar 2023 13:01:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v5 1/2] function_graph: Support recording and printing the return value of function Content-Language: en-US To: Florian Kauer , Steven Rostedt , mhiramat@kernel.org Cc: linux@armlinux.org.uk, mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, palmer@dabbelt.com, paul.walmsley@sifive.com, tglx@linutronix.de, dave.hansen@linux.intel.com, x86@kernel.org, mingo@redhat.com, xiehuan09@gmail.com, dinghui@sangfor.com.cn, huangcun@sangfor.com.cn, dolinux.peng@gmail.com, linux-trace-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230320131650.482594-1-pengdonglin@sangfor.com.cn> <20230320131650.482594-2-pengdonglin@sangfor.com.cn> <2eeef5a3-cbe7-7a01-489a-87c5ac00adf7@linutronix.de> <20230321104413.43a81ffb@gandalf.local.home> From: Donglin Peng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlDQxhOVk4fQ0xKSk9DTR4fQ1UTARMWGhIXJBQOD1 lXWRgSC1lBWUpKTFVKSEhVTk1VSUlZV1kWGg8SFR0UWUFZT0tIVUpKS09ISFVKS0tVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Ogw6CCo4Ez0ONRUMIQgdIRZW ExMKFAhVSlVKTUxCT01KSUxLQ05IVTMWGhIXVQseFRwfFBUcFxIVOwgaFRwdFAlVGBQWVRgVRVlX WRILWUFZSkpMVUpISFVOTVVJSVlXWQgBWUFOSkhCNwY+ X-HM-Tid: 0a8707b143a22eb7kusn9a1045802e1 X-HM-MType: 1 X-Spam-Status: No, score=-0.0 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/21 23:11, Florian Kauer wrote: > On 21.03.23 15:44, Steven Rostedt wrote: >> On Tue, 21 Mar 2023 15:09:40 +0100 >> Florian Kauer wrote: >> >>> On 20.03.23 14:16, Donglin Peng wrote: >>>> When using the function_graph tracer to analyze system call failures, >>>> it can be time-consuming to analyze the trace logs and locate the kernel >>>> function that first returns an error. This change aims to simplify the >>>> process by recording the function return value to the 'retval' member of >>>> 'ftrace_graph_ent' and printing it when outputing the trace log. >>> >>> I just came across your patch by pure luck and it helped me a lot >>> to trace down a problem I had, thanks! >>> >>> So you can have my >>> Tested-by: Florian Kauer >>> >>>> New trace options are introduced: funcgraph-retval and graph_retval_hex. >>> >>> I would personally prefer to have the second option scoped better, so for example >>> "funcgraph-retval-hex". >> >> That could be an ftrace option. > > What do you mean? In the current implementation both funcgraph-retval and graph_retval_hex > are options for the function_graph tracer, but one is prefixed with "funcgraph-" as nearly > all other options for the function_graph tracer and one is not (and is even snake_case, while > the others are kebab-case). So it just looks inconsistent for me, but there might be a reason? Agree, I also think "funcgraph-retval-hex" may look better. Hi Hiramatsu, what do you think? > > By the way: The documentation patch also references "function-retval" instead of > "funcgraph-retval" in the documentation of the graph_retval_hex option. Thanks, it has been removed in v6. > >> Anyway, could you tell us your use case, and that could go into the change >> log of this patch as "one use case that this helped with". > > Nothing spectacular. I just wanted to find out why ICMP port unreachable messages > sporadically lead to -111 (Connection Refused) for __sys_sendto() when IP_RECVERR is set > and the call never fails if IP_RECVERR is not set. (I am still unsure if this is > REALLY intended behavior, but at least it makes sense why this occurs when reading > the sources). > > And with this patch, the -111 is directly popping up in the trace, but I do not think > that my missing knowledge about details of the kernel network stack > really qualifies as a good argument ;-) > > Greetings, > Florian