[{"id":31196,"web_url":"https://patchwork.libcamera.org/comment/31196/","msgid":"<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>","date":"2024-09-12T16:58:54","subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Paul Elder (2024-09-12 17:49:09)\n> Add -finstrument-functions to debug (and debugoptimized) build types.\n> This will mainly be used for tracing functions with lttng by\n> LD_PRELOADing liblttng-ust-cyg-profile.so (or\n> liblttng-ust-cyg-profile-fast.so).\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  meson.build | 6 ++++++\n>  1 file changed, 6 insertions(+)\n> \n> diff --git a/meson.build b/meson.build\n> index 432ae1337..e8014e77f 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -109,6 +109,12 @@ common_arguments = [\n>      '-include', meson.current_build_dir() / 'config.h',\n>  ]\n>  \n> +if get_option('buildtype').startswith('debug')\n\nWhy is this added to debug builds rather than any build with 'tracing\nenabled' ?\n\nmeson_options has:\n\noption('tracing',\n        type : 'feature',\n        value : 'auto',\n        description : 'Enable tracing (based on lttng)')\n\nso this could be 'if get_option('tracing') ?\n\n\n> +    common_arguments += [\n> +        '-finstrument-functions',\n> +    ]\n> +endif\n> +\n>  c_arguments = []\n>  cpp_arguments = []\n>  \n> -- \n> 2.39.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A4D5EC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Sep 2024 16:59:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4AE5A634FC;\n\tThu, 12 Sep 2024 18:58:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 81A65634F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Sep 2024 18:58:57 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ED32EB0B;\n\tThu, 12 Sep 2024 18:57:38 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"JC6pHXGe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726160259;\n\tbh=dkgFUP0pNlzYWAz4jYDIwp/vSt2umAOgtPAXWUd6lhk=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=JC6pHXGekKwnauclTzTVCP7hDvW6XinlPQao2VjxDUEPUMDij3dW8vx3tuB4tTKng\n\tV4+JQOee8thTmnJo/P1Dx5xU2TLe5uo/SwFAoZ26d/cBgwbrT1dK/RaPatOn70n5gA\n\t3CCJYtLmv+EwNAnumnv56fI1KBIn6o3rsheasdyk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240912164909.2083093-1-paul.elder@ideasonboard.com>","References":"<20240912164909.2083093-1-paul.elder@ideasonboard.com>","Subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 12 Sep 2024 17:58:54 +0100","Message-ID":"<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31197,"web_url":"https://patchwork.libcamera.org/comment/31197/","msgid":"<ZuNyk681ki_EEaKV@pyrite.rasen.tech>","date":"2024-09-12T23:00:35","subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Thu, Sep 12, 2024 at 05:58:54PM +0100, Kieran Bingham wrote:\n> Quoting Paul Elder (2024-09-12 17:49:09)\n> > Add -finstrument-functions to debug (and debugoptimized) build types.\n> > This will mainly be used for tracing functions with lttng by\n> > LD_PRELOADing liblttng-ust-cyg-profile.so (or\n> > liblttng-ust-cyg-profile-fast.so).\n> > \n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > ---\n> >  meson.build | 6 ++++++\n> >  1 file changed, 6 insertions(+)\n> > \n> > diff --git a/meson.build b/meson.build\n> > index 432ae1337..e8014e77f 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -109,6 +109,12 @@ common_arguments = [\n> >      '-include', meson.current_build_dir() / 'config.h',\n> >  ]\n> >  \n> > +if get_option('buildtype').startswith('debug')\n> \n> Why is this added to debug builds rather than any build with 'tracing\n> enabled' ?\n\nOn one hand, good point.\n\nOn the other hand, the function tracing *should* work without tracing\nenabled in libcamera. So technically they can be used separately. It's a\nmatter of if we think there's an actual purpose for enabling it.\n\n\nPaul\n\n> \n> meson_options has:\n> \n> option('tracing',\n>         type : 'feature',\n>         value : 'auto',\n>         description : 'Enable tracing (based on lttng)')\n> \n> so this could be 'if get_option('tracing') ?\n> \n> \n> > +    common_arguments += [\n> > +        '-finstrument-functions',\n> > +    ]\n> > +endif\n> > +\n> >  c_arguments = []\n> >  cpp_arguments = []\n> >  \n> > -- \n> > 2.39.2\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C7F6EC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Sep 2024 23:00:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68B91634FC;\n\tFri, 13 Sep 2024 01:00:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D408618F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Sep 2024 01:00:47 +0200 (CEST)","from pyrite.rasen.tech (213-229-8-243.static.upcbusiness.at\n\t[213.229.8.243])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 73FCA496;\n\tFri, 13 Sep 2024 00:59:25 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nAk0a2SD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726181965;\n\tbh=7l8EwqRJCa3k5O7ZyvTgpznQpy/SOGVt8KdQ5QFNbiY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nAk0a2SDeKx0oTtHNwNPtyeR+iC8cwA0o9fEV/dq33ZgA8g/5gsmKtJ2mDCwp628R\n\tklDd9glbY//eONhavDXLASSbb/Noift5Tx45QN2K6WFKX5GBLR6dEVB9PXdNluhlCQ\n\t5ilCHUczZmZ4X1RGcggHl+cbX/ya/U28SSkAPfNk=","Date":"Fri, 13 Sep 2024 01:00:35 +0200","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","Message-ID":"<ZuNyk681ki_EEaKV@pyrite.rasen.tech>","References":"<20240912164909.2083093-1-paul.elder@ideasonboard.com>\n\t<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31198,"web_url":"https://patchwork.libcamera.org/comment/31198/","msgid":"<20240912230714.GA2032@pendragon.ideasonboard.com>","date":"2024-09-12T23:07:14","subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Sep 13, 2024 at 01:00:35AM +0200, Paul Elder wrote:\n> On Thu, Sep 12, 2024 at 05:58:54PM +0100, Kieran Bingham wrote:\n> > Quoting Paul Elder (2024-09-12 17:49:09)\n> > > Add -finstrument-functions to debug (and debugoptimized) build types.\n> > > This will mainly be used for tracing functions with lttng by\n> > > LD_PRELOADing liblttng-ust-cyg-profile.so (or\n> > > liblttng-ust-cyg-profile-fast.so).\n> > > \n> > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > > ---\n> > >  meson.build | 6 ++++++\n> > >  1 file changed, 6 insertions(+)\n> > > \n> > > diff --git a/meson.build b/meson.build\n> > > index 432ae1337..e8014e77f 100644\n> > > --- a/meson.build\n> > > +++ b/meson.build\n> > > @@ -109,6 +109,12 @@ common_arguments = [\n> > >      '-include', meson.current_build_dir() / 'config.h',\n> > >  ]\n> > >  \n> > > +if get_option('buildtype').startswith('debug')\n> > \n> > Why is this added to debug builds rather than any build with 'tracing\n> > enabled' ?\n> \n> On one hand, good point.\n> \n> On the other hand, the function tracing *should* work without tracing\n> enabled in libcamera. So technically they can be used separately. It's a\n> matter of if we think there's an actual purpose for enabling it.\n\nDo you envision function tracing to be used in production, or should\ndebugging issues in production rely on trace points only ?\n\n> > meson_options has:\n> > \n> > option('tracing',\n> >         type : 'feature',\n> >         value : 'auto',\n> >         description : 'Enable tracing (based on lttng)')\n> > \n> > so this could be 'if get_option('tracing') ?\n> > \n> > \n> > > +    common_arguments += [\n> > > +        '-finstrument-functions',\n> > > +    ]\n> > > +endif\n> > > +\n> > >  c_arguments = []\n> > >  cpp_arguments = []\n> > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 70ADBC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Sep 2024 23:07:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 190D0634FC;\n\tFri, 13 Sep 2024 01:07:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B2859618F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Sep 2024 01:07:56 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(213-229-8-243.static.upcbusiness.at [213.229.8.243])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D22C8496;\n\tFri, 13 Sep 2024 01:06:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SWxHs7JZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726182397;\n\tbh=WZDl0RCtMIKAyf0g555M0dczSp+/1adafJxoyU6iAac=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SWxHs7JZ8P4vid6OJP3fc5ABgR2AUatQxug39FUdVu3gv0MxdnUv2js5J9NveRSsQ\n\tez2wracX0u2sYSLRNcNU8abimGGLPQHie4SvSHwG8NzH/3xrLXkd4r0c/hay69xwtE\n\tAMqy7h5I5WSktH5A0kYR88MI8XmjdEndg7p4z7Ic=","Date":"Fri, 13 Sep 2024 02:07:14 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","Message-ID":"<20240912230714.GA2032@pendragon.ideasonboard.com>","References":"<20240912164909.2083093-1-paul.elder@ideasonboard.com>\n\t<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>\n\t<ZuNyk681ki_EEaKV@pyrite.rasen.tech>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<ZuNyk681ki_EEaKV@pyrite.rasen.tech>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32310,"web_url":"https://patchwork.libcamera.org/comment/32310/","msgid":"<Zz3xH6e5nfSmtnsO@pyrite.rasen.tech>","date":"2024-11-20T14:24:31","subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Fri, Sep 13, 2024 at 02:07:14AM +0300, Laurent Pinchart wrote:\n> On Fri, Sep 13, 2024 at 01:00:35AM +0200, Paul Elder wrote:\n> > On Thu, Sep 12, 2024 at 05:58:54PM +0100, Kieran Bingham wrote:\n> > > Quoting Paul Elder (2024-09-12 17:49:09)\n> > > > Add -finstrument-functions to debug (and debugoptimized) build types.\n> > > > This will mainly be used for tracing functions with lttng by\n> > > > LD_PRELOADing liblttng-ust-cyg-profile.so (or\n> > > > liblttng-ust-cyg-profile-fast.so).\n> > > > \n> > > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > > > ---\n> > > >  meson.build | 6 ++++++\n> > > >  1 file changed, 6 insertions(+)\n> > > > \n> > > > diff --git a/meson.build b/meson.build\n> > > > index 432ae1337..e8014e77f 100644\n> > > > --- a/meson.build\n> > > > +++ b/meson.build\n> > > > @@ -109,6 +109,12 @@ common_arguments = [\n> > > >      '-include', meson.current_build_dir() / 'config.h',\n> > > >  ]\n> > > >  \n> > > > +if get_option('buildtype').startswith('debug')\n> > > \n> > > Why is this added to debug builds rather than any build with 'tracing\n> > > enabled' ?\n> > \n> > On one hand, good point.\n> > \n> > On the other hand, the function tracing *should* work without tracing\n> > enabled in libcamera. So technically they can be used separately. It's a\n> > matter of if we think there's an actual purpose for enabling it.\n> \n> Do you envision function tracing to be used in production, or should\n> debugging issues in production rely on trace points only ?\n\ntbh I'm not sure. But taking inspiration from the kernel, isn't ftrace\nusually disabled on production builds?\n\n\nPaul\n\n> \n> > > meson_options has:\n> > > \n> > > option('tracing',\n> > >         type : 'feature',\n> > >         value : 'auto',\n> > >         description : 'Enable tracing (based on lttng)')\n> > > \n> > > so this could be 'if get_option('tracing') ?\n> > > \n> > > \n> > > > +    common_arguments += [\n> > > > +        '-finstrument-functions',\n> > > > +    ]\n> > > > +endif\n> > > > +\n> > > >  c_arguments = []\n> > > >  cpp_arguments = []\n> > > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 08CEBC32F5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Nov 2024 14:24:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3B5C865F54;\n\tWed, 20 Nov 2024 15:24:44 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E9E665898\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Nov 2024 15:24:42 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:6f8:18b9:c92f:628d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E843955A;\n\tWed, 20 Nov 2024 15:24:22 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FEE0jjBj\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732112664;\n\tbh=SnkfUE5V90i3Qrpj9IxHDT7gXO6Wl/bm9dRNKt4q2BU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FEE0jjBj0RzmJ7+xppYQHlY50eONR1Tn2EeSze/GLq2yRxFgCQ1m2HB9ws4GLj1j3\n\t5woetORbl9M6rFRtODZ4A6mgdeaWl7GqWtHzVZWuLGEiwPfRH8tgFVBfxFx1YE2okE\n\t1V/Kh74N3fe8j6P7uoFC3reIotWVnQe4YozAx5p4=","Date":"Wed, 20 Nov 2024 23:24:31 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","Message-ID":"<Zz3xH6e5nfSmtnsO@pyrite.rasen.tech>","References":"<20240912164909.2083093-1-paul.elder@ideasonboard.com>\n\t<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>\n\t<ZuNyk681ki_EEaKV@pyrite.rasen.tech>\n\t<20240912230714.GA2032@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240912230714.GA2032@pendragon.ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32311,"web_url":"https://patchwork.libcamera.org/comment/32311/","msgid":"<20241120151220.GY12409@pendragon.ideasonboard.com>","date":"2024-11-20T15:12:20","subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Nov 20, 2024 at 11:24:31PM +0900, Paul Elder wrote:\n> On Fri, Sep 13, 2024 at 02:07:14AM +0300, Laurent Pinchart wrote:\n> > On Fri, Sep 13, 2024 at 01:00:35AM +0200, Paul Elder wrote:\n> > > On Thu, Sep 12, 2024 at 05:58:54PM +0100, Kieran Bingham wrote:\n> > > > Quoting Paul Elder (2024-09-12 17:49:09)\n> > > > > Add -finstrument-functions to debug (and debugoptimized) build types.\n> > > > > This will mainly be used for tracing functions with lttng by\n> > > > > LD_PRELOADing liblttng-ust-cyg-profile.so (or\n> > > > > liblttng-ust-cyg-profile-fast.so).\n> > > > > \n> > > > > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > > > > ---\n> > > > >  meson.build | 6 ++++++\n> > > > >  1 file changed, 6 insertions(+)\n> > > > > \n> > > > > diff --git a/meson.build b/meson.build\n> > > > > index 432ae1337..e8014e77f 100644\n> > > > > --- a/meson.build\n> > > > > +++ b/meson.build\n> > > > > @@ -109,6 +109,12 @@ common_arguments = [\n> > > > >      '-include', meson.current_build_dir() / 'config.h',\n> > > > >  ]\n> > > > >  \n> > > > > +if get_option('buildtype').startswith('debug')\n> > > > \n> > > > Why is this added to debug builds rather than any build with 'tracing\n> > > > enabled' ?\n> > > \n> > > On one hand, good point.\n> > > \n> > > On the other hand, the function tracing *should* work without tracing\n> > > enabled in libcamera. So technically they can be used separately. It's a\n> > > matter of if we think there's an actual purpose for enabling it.\n> > \n> > Do you envision function tracing to be used in production, or should\n> > debugging issues in production rely on trace points only ?\n> \n> tbh I'm not sure. But taking inspiration from the kernel, isn't ftrace\n> usually disabled on production builds?\n\nftrace seems to be enabled in Debian kernels, so that would point to\nmaking it usable in production.\n\nI lack enough experience with tracing to tell what the best option is.\n\n> > > > meson_options has:\n> > > > \n> > > > option('tracing',\n> > > >         type : 'feature',\n> > > >         value : 'auto',\n> > > >         description : 'Enable tracing (based on lttng)')\n> > > > \n> > > > so this could be 'if get_option('tracing') ?\n> > > > \n> > > > \n> > > > > +    common_arguments += [\n> > > > > +        '-finstrument-functions',\n> > > > > +    ]\n> > > > > +endif\n> > > > > +\n> > > > >  c_arguments = []\n> > > > >  cpp_arguments = []\n> > > > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 41746C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Nov 2024 15:12:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C753665F69;\n\tWed, 20 Nov 2024 16:12:31 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ABF8865F54\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Nov 2024 16:12:29 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5228B3E;\n\tWed, 20 Nov 2024 16:12:11 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ECMMuR/7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732115531;\n\tbh=D/PntBxE8to2f7RyiRQXtSAvigfxoUHUu5pD7E7HtZM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ECMMuR/7VEjuga+tPFImtAZCbrtDmiDB4nASdDrEVGFmmJFQ8bJIKalBV+wTFgGk7\n\t5/Mxg5k0LKmpql95FS+6WfJ3qY3SMQr6bWn49mFOoaGbICQ9UrRgRhZ6OLLiDWO/WZ\n\tQMyfnaMD0lclbel65qORPbrhRVIFfqnvFPUMWjuc=","Date":"Wed, 20 Nov 2024 17:12:20 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] meson: Add -finstrument-functions to debug builds","Message-ID":"<20241120151220.GY12409@pendragon.ideasonboard.com>","References":"<20240912164909.2083093-1-paul.elder@ideasonboard.com>\n\t<172616033423.3474483.8890937323637820108@ping.linuxembedded.co.uk>\n\t<ZuNyk681ki_EEaKV@pyrite.rasen.tech>\n\t<20240912230714.GA2032@pendragon.ideasonboard.com>\n\t<Zz3xH6e5nfSmtnsO@pyrite.rasen.tech>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<Zz3xH6e5nfSmtnsO@pyrite.rasen.tech>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]