[{"id":305,"web_url":"https://patchwork.libcamera.org/comment/305/","msgid":"<680347e1-7cd6-0eb8-e9ff-86cb147b67b3@ideasonboard.com>","date":"2019-01-14T13:44:21","subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn 11/01/2019 16:07, Jacopo Mondi wrote:\n> Add a few debug printouts that help follow the library intialization\n> process: what pipeline handlers are registered, what media devices are\n> created, and which pipeline manager gets matches with the current\n> system.\n\nGreat - I think this will be useful to have some visibility while\ndeveloping, and we can easily disable the DBG output when we add\nLogLevel selection. (and we'll probably default it above the debug level\nof course).\n\n\n> \n> The resulting output is the following, on IPU3 devices:\n> DBG pipeline_handler.cpp:119 Pipeline handler: \"PipeHandlerVimc\" registered\n> DBG pipeline_handler.cpp:119 Pipeline handler: \"PipelineHandlerIPU3\" registered\n> DBG device_enumerator.cpp:214 New media device: ipu3-imgu created from: /dev/media0\n> DBG device_enumerator.cpp:214 New media device: ipu3-cio2 created from: /dev/media1\n> DBG device_enumerator.cpp:255 Succesfull match for media device: ipu3-cio2\n> DBG device_enumerator.cpp:255 Succesfull match for media device: ipu3-imgu\n> DBG pipeline_handler.cpp:150 Pipeline handler: \"PipelineHandlerIPU3\" matched\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/device_enumerator.cpp | 8 +++++++-\n>  src/libcamera/pipeline_handler.cpp  | 5 ++++-\n>  2 files changed, 11 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\n> index 0d18e75..c1ddd7c 100644\n> --- a/src/libcamera/device_enumerator.cpp\n> +++ b/src/libcamera/device_enumerator.cpp\n> @@ -211,6 +211,9 @@ int DeviceEnumerator::addDevice(const std::string &devnode)\n>  \t\treturn ret;\n>  \t}\n> \n> +\tLOG(Debug) << \"New media device: \" << media->driver()\n> +\t\t   << \" created from: \" << devnode;\n> +\n>  \t/* Associate entities to device node paths. */\n>  \tfor (MediaEntity *entity : media->entities()) {\n>  \t\tif (entity->deviceMajor() == 0 && entity->deviceMinor() == 0)\n> @@ -248,8 +251,11 @@ MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const\n>  \t\tif (dev->busy())\n>  \t\t\tcontinue;\n> \n> -\t\tif (dm.match(dev))\n> +\t\tif (dm.match(dev)) {\n> +\t\t\tLOG(Debug) << \"Succesfull match for media device: \"\n\ns/Succesfull/Successful/\n\n> +\t\t\t\t   << dev->driver();\n>  \t\t\treturn dev;\n> +\t\t}\n>  \t}\n> \n>  \treturn nullptr;\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index ee76948..9299c28 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -116,6 +116,7 @@ void PipelineHandlerFactory::registerType(const std::string &name,\n>  \t\treturn;\n>  \t}\n> \n> +\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" registered\";\n>  \tfactories[name] = factory;\n>  }\n> \n> @@ -145,8 +146,10 @@ PipelineHandler *PipelineHandlerFactory::create(const std::string &name,\n> \n>  \tPipelineHandler *pipe = it->second->create();\n> \n> -\tif (pipe->match(enumerator))\n> +\tif (pipe->match(enumerator)) {\n> +\t\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n\n(not for this patch - just ideas out loud)\n\nCan/Should we make a function/macro called\n\t quoted((os), (_s))\n\n which will do:\n\n  os << (\"\\\"\" << (_s) << \"\\\"\")\n\nLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\nLOG(Debug) << \"Pipeline handler: \" << quoted(name) << \" matched\";\n\n\n>  \t\treturn pipe;\n> +\t}\n> \n>  \tdelete pipe;\n>  \treturn nullptr;\n> --\n> 2.20.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["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 3725760C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Jan 2019 14:44:24 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 975F6530;\n\tMon, 14 Jan 2019 14:44:23 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547473463;\n\tbh=mXoqlx1x14jfCqEBHtIaeLXjPfE8jQW4L/h+hzdObH8=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=FIP6Ne31bStvY4Xw0K4aGxFJ7akb2NOfneGoLdHw+EsKRZZUucN4AEdyS133InwdB\n\t1uoPBsLNUIxazlh30of1uIHTwJ1LMrLmUK8Jy2U1gtSfbDyrRf8ESq/x+dIfKbhcMY\n\tajxBW2w5BM2W3dMfTWkQh8vuOBpCX110FZQtOXzw=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20190111160737.25094-1-jacopo@jmondi.org>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQE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ljaRsCdP\n\t7WCIECWYem6pLwaw6IAL7oX+tEqIMPph/G/jwZcdS6Hkyt/esHPuHNwX4guqTbVEuRqbDzDI\n\t2DJO5FbxABEBAAGJAiUEGAEKAA8CGwwFAlnDlGsFCQeA/gIACgkQoR5GchCkYf1yYRAAq+Yo\n\tnbf9DGdK1kTAm2RTFg+w9oOp2Xjqfhds2PAhFFvrHQg1XfQR/UF/SjeUmaOmLSczM0s6XMeO\n\tVcE77UFtJ/+hLo4PRFKm5X1Pcar6g5m4xGqa+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<680347e1-7cd6-0eb8-e9ff-86cb147b67b3@ideasonboard.com>","Date":"Mon, 14 Jan 2019 13:44:21 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.2.1","MIME-Version":"1.0","In-Reply-To":"<20190111160737.25094-1-jacopo@jmondi.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 14 Jan 2019 13:44:24 -0000"}},{"id":311,"web_url":"https://patchwork.libcamera.org/comment/311/","msgid":"<3383522.SeLiCC3bgp@avalon>","date":"2019-01-15T02:02:46","subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello,\n\nOn Monday, 14 January 2019 15:44:21 EET Kieran Bingham wrote:\n> On 11/01/2019 16:07, Jacopo Mondi wrote:\n> > Add a few debug printouts that help follow the library intialization\n> > process: what pipeline handlers are registered, what media devices are\n> > created, and which pipeline manager gets matches with the current\n> > system.\n> \n> Great - I think this will be useful to have some visibility while\n> developing, and we can easily disable the DBG output when we add\n> LogLevel selection. (and we'll probably default it above the debug level\n> of course).\n> \n> > The resulting output is the following, on IPU3 devices:\n> > DBG pipeline_handler.cpp:119 Pipeline handler: \"PipeHandlerVimc\"\n> > registered\n> > DBG pipeline_handler.cpp:119 Pipeline handler: \"PipelineHandlerIPU3\"\n> > registered DBG device_enumerator.cpp:214 New media device: ipu3-imgu\n> > created from: /dev/media0 DBG device_enumerator.cpp:214 New media device:\n> > ipu3-cio2 created from: /dev/media1 DBG device_enumerator.cpp:255\n> > Succesfull match for media device: ipu3-cio2 DBG\n> > device_enumerator.cpp:255 Succesfull match for media device: ipu3-imgu\n> > DBG pipeline_handler.cpp:150 Pipeline handler: \"PipelineHandlerIPU3\"\n> > matched\n> > \n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> > \n> >  src/libcamera/device_enumerator.cpp | 8 +++++++-\n> >  src/libcamera/pipeline_handler.cpp  | 5 ++++-\n> >  2 files changed, 11 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/src/libcamera/device_enumerator.cpp\n> > b/src/libcamera/device_enumerator.cpp index 0d18e75..c1ddd7c 100644\n> > --- a/src/libcamera/device_enumerator.cpp\n> > +++ b/src/libcamera/device_enumerator.cpp\n> > @@ -211,6 +211,9 @@ int DeviceEnumerator::addDevice(const std::string\n> > &devnode)\n> >  \t\treturn ret;\n> >  \t}\n> > \n> > +\tLOG(Debug) << \"New media device: \" << media->driver()\n> > +\t\t   << \" created from: \" << devnode;\n> > +\n\nDo we need the \":\" ? This would print\n\nNew media device: uvcvideo created from: /dev/media0\n\nWouldn't the following be more readable ?\n\nNew media device \"uvcvideo created from /dev/media0\n\nThat would be obtained by\n\n\tLOG(Debug) << \"New media device \\\"\" << media->driver()\n\t\t<< \"\\\" created from \" << devnode;\n\n> >  \t/* Associate entities to device node paths. */\n> >  \tfor (MediaEntity *entity : media->entities()) {\n> >  \t\tif (entity->deviceMajor() == 0 && entity->deviceMinor() == 0)\n> > @@ -248,8 +251,11 @@ MediaDevice *DeviceEnumerator::search(const\n> > DeviceMatch &dm) const\n> >  \t\tif (dev->busy())\n> >  \t\t\tcontinue;\n> > \n> > -\t\tif (dm.match(dev))\n> > +\t\tif (dm.match(dev)) {\n> > +\t\t\tLOG(Debug) << \"Succesfull match for media device: \"\n> \n> s/Succesfull/Successful/\n> \n> > +\t\t\t\t   << dev->driver();\n\nSame here, I'd remove the \":\".\n\n> >  \t\t\treturn dev;\n> > +\t\t}\n> >  \t}\n> >  \t\n> >  \treturn nullptr;\n> > diff --git a/src/libcamera/pipeline_handler.cpp\n> > b/src/libcamera/pipeline_handler.cpp index ee76948..9299c28 100644\n> > --- a/src/libcamera/pipeline_handler.cpp\n> > +++ b/src/libcamera/pipeline_handler.cpp\n> > @@ -116,6 +116,7 @@ void PipelineHandlerFactory::registerType(const\n> > std::string &name,\n> >  \t\treturn;\n> >  \t}\n> > \n> > +\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" registered\";\n\nAnd here\n\n\tLOG(Debug) << \"Registered pipeline handler \\\"\" << name << \"\\\"\";\n\n> >  \tfactories[name] = factory;\n> >  }\n> > \n> > @@ -145,8 +146,10 @@ PipelineHandler *PipelineHandlerFactory::create(const\n> > std::string &name,\n> >  \tPipelineHandler *pipe = it->second->create();\n> > \n> > -\tif (pipe->match(enumerator))\n> > +\tif (pipe->match(enumerator)) {\n> > +\t\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n\nAnd removing the \":\" here too.\n\n> (not for this patch - just ideas out loud)\n> \n> Can/Should we make a function/macro called\n> \t quoted((os), (_s))\n> \n>  which will do:\n> \n>   os << (\"\\\"\" << (_s) << \"\\\"\")\n\nI suppose this would be\n\n#define quote(s)\t\t\"\\\"\" << s << \"\\\"\"\n\n> LOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n> LOG(Debug) << \"Pipeline handler: \" << quoted(name) << \" matched\";\n\nWouldn't it reduce readability by hiding a simple construct behind a macro ? I \nknow it's tempting to avoid writing the escape sequence...\n\n> >  \t\treturn pipe;\n> > +\t}\n> > \n> >  \tdelete pipe;\n> >  \treturn nullptr;\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 84C2560B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 03:01:31 +0100 (CET)","from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CF96755C;\n\tTue, 15 Jan 2019 03:01:30 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547517691;\n\tbh=MSTGiroYOPO8Vt2VycW5+CK9CS+Lfufde8RrlgaIedk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=i+IjVo2wiy5U9YxrFLa4f7l4BRanRyMXfdSDLefNW7SdoogHyQFMeaP+7JONIL809\n\tscsiT7C5ir65p2Zr3Ytr6Dse15dHaBlUwS8AqF1rNBwvObQxgvrHXMsq1aj9IcSazW\n\t7sJG4qk+kSC8pO0cHBmfPWw6ZgG/T9/ohRaQ2Itw=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org, kieran.bingham@ideasonboard.com","Date":"Tue, 15 Jan 2019 04:02:46 +0200","Message-ID":"<3383522.SeLiCC3bgp@avalon>","Organization":"Ideas on Board Oy","In-Reply-To":"<680347e1-7cd6-0eb8-e9ff-86cb147b67b3@ideasonboard.com>","References":"<20190111160737.25094-1-jacopo@jmondi.org>\n\t<680347e1-7cd6-0eb8-e9ff-86cb147b67b3@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"7Bit","Content-Type":"text/plain; charset=\"us-ascii\"","Subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 15 Jan 2019 02:01:31 -0000"}},{"id":314,"web_url":"https://patchwork.libcamera.org/comment/314/","msgid":"<c6769cc5-b9fb-9bbb-24fc-bdfd83221858@ideasonboard.com>","date":"2019-01-15T11:00:50","subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 15/01/2019 02:02, Laurent Pinchart wrote:\n> Hello,\n\n<snip>\n\n>>>\n>>> -\tif (pipe->match(enumerator))\n>>> +\tif (pipe->match(enumerator)) {\n>>> +\t\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n> \n> And removing the \":\" here too.\n> \n>> (not for this patch - just ideas out loud)\n>>\n>> Can/Should we make a function/macro called\n>> \t quoted((os), (_s))\n>>\n>>  which will do:\n>>\n>>   os << (\"\\\"\" << (_s) << \"\\\"\")\n> \n> I suppose this would be\n> \n> #define quote(s)\t\t\"\\\"\" << s << \"\\\"\"\n\nAh yes - I was overcomplicating already :)\n\n> \n>> LOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n>> LOG(Debug) << \"Pipeline handler: \" << quoted(name) << \" matched\";\n> \n> Wouldn't it reduce readability by hiding a simple construct behind a macro ? I \n> know it's tempting to avoid writing the escape sequence...\n\nDoes it? I guess it's subjective.\n\nIt is a simple construct yes, but IMO the escaping of the {\"} hinders\nreadability more. A quick glance here:\n\n  : \\\"\" << name << \"\\\" matched\n\ncould look like we are sending the string\n  { name \"\\\" matched } as if it was a path with backslashes or such...\n\n(Yes I'm aware that the example above is taken slightly out of context,\nand it was done so purposefully to represent 'a quick glance')...\n\n\nAlso a helper here would ensure that quotes are correctly terminated, as\ndemonstrated in Jacopo's patch f1caaaf387 (\"libcamera: Debug printouts\nfixes\") which adds in a missing final \"\\\"\";\n\n+\tLOG(Debug) << \"Successful match for media device \\\"\"\n+\t\t   << dev->driver() << \"\\\"\";\n\nAlthough in that particular case - I think that log statement could have\nbeen on one line where it would then be more obvious too.\n\n\tLOG(Debug) << \"Successful match for media device \"\n\t\t   << quoted(dev->driver());\n\nAnyway - it was just an idea/suggestion, I'm not tied to it ...\n\n\n\n>>>  \t\treturn pipe;\n>>> +\t}\n>>>\n>>>  \tdelete pipe;\n>>>  \treturn nullptr;\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F44F60C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 12:00:55 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0D1264F8;\n\tTue, 15 Jan 2019 12:00:53 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547550053;\n\tbh=VwNMlGIlZjPhT+ywB/tNl4oV+7Cs+LGUERsOTwlCzrU=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=bj8pIxmZxO54TzQx3jn7v9kmD6wdAYP4D1q2NpybfTsBC0uNxyWzuF/xeXawiUX3g\n\tcn0FHBI3tI/fwEtmJ9A0M3C6nkl5pxZkUowFnLkSAFyJlHf6g4nUAdRsBcQ/D0sum4\n\tqaOFvltgt0rOJ91wnVqz/0aS1CVlz375Wb85Kipc=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190111160737.25094-1-jacopo@jmondi.org>\n\t<680347e1-7cd6-0eb8-e9ff-86cb147b67b3@ideasonboard.com>\n\t<3383522.SeLiCC3bgp@avalon>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36\n\t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sz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<c6769cc5-b9fb-9bbb-24fc-bdfd83221858@ideasonboard.com>","Date":"Tue, 15 Jan 2019 11:00:50 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.2.1","MIME-Version":"1.0","In-Reply-To":"<3383522.SeLiCC3bgp@avalon>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 15 Jan 2019 11:00:55 -0000"}},{"id":315,"web_url":"https://patchwork.libcamera.org/comment/315/","msgid":"<2066264.TPJSTNnpJ2@avalon>","date":"2019-01-15T13:28:45","subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Tuesday, 15 January 2019 13:00:50 EET Kieran Bingham wrote:\n> On 15/01/2019 02:02, Laurent Pinchart wrote:\n> > Hello,\n> \n> <snip>\n> \n> >>> -\tif (pipe->match(enumerator))\n> >>> +\tif (pipe->match(enumerator)) {\n> >>> +\t\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n> > \n> > And removing the \":\" here too.\n> > \n> >> (not for this patch - just ideas out loud)\n> >> \n> >> Can/Should we make a function/macro called\n> >> \n> >> \t quoted((os), (_s))\n> >>  \n> >>  which will do:\n> >>   os << (\"\\\"\" << (_s) << \"\\\"\")\n> > \n> > I suppose this would be\n> > \n> > #define quote(s)\t\t\"\\\"\" << s << \"\\\"\"\n> \n> Ah yes - I was overcomplicating already :)\n> \n> >> LOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n> >> LOG(Debug) << \"Pipeline handler: \" << quoted(name) << \" matched\";\n> > \n> > Wouldn't it reduce readability by hiding a simple construct behind a macro\n> > ? I know it's tempting to avoid writing the escape sequence...\n> \n> Does it? I guess it's subjective.\n> \n> It is a simple construct yes, but IMO the escaping of the {\"} hinders\n> \n> readability more. A quick glance here:\n>   : \\\"\" << name << \"\\\" matched\n> \n> could look like we are sending the string\n>   { name \"\\\" matched } as if it was a path with backslashes or such...\n> \n> (Yes I'm aware that the example above is taken slightly out of context,\n> and it was done so purposefully to represent 'a quick glance')...\n> \n> \n> Also a helper here would ensure that quotes are correctly terminated, as\n> demonstrated in Jacopo's patch f1caaaf387 (\"libcamera: Debug printouts\n> fixes\") which adds in a missing final \"\\\"\";\n> \n> +\tLOG(Debug) << \"Successful match for media device \\\"\"\n> +\t\t   << dev->driver() << \"\\\"\";\n> \n> Although in that particular case - I think that log statement could have\n> been on one line where it would then be more obvious too.\n> \n> \tLOG(Debug) << \"Successful match for media device \"\n> \t\t   << quoted(dev->driver());\n> \n> Anyway - it was just an idea/suggestion, I'm not tied to it ...\n\nIf you submit a patch I won't reject it :-) I would however prefer a function \ninstead of a macro, in order to avoid claiming such a generic name in the \nglobal namespace. One option would be, in log.h,\n\n \tLogSeverity severity_;\n };\n \n+namespace log {\n+\n+static inline std::string quoted(const std::string &name)\n+{\n+\treturn \"\\\"\" + name + \"\\\"\";\n+}\n+\n+} /* namespace log */\n+\n \n #define LOG(severity) LogMessage(__FILE__, __LINE__, Log##severity).stream()\n \n(Whether we want a log namespace there is debatable). The function would be \nused as\n\n\tLOG(Debug) << \"Print a quoted \" << log::quoted(name);\n\nI haven't studied whether there could be efficiency concerns due to string \nconcatenation.\n\n> >>>  \t\treturn pipe;\n> >>> +\t}\n> >>> \n> >>>  \tdelete pipe;\n> >>>  \treturn nullptr;\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 400AD60C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 14:27:30 +0100 (CET)","from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6EC4A4F8;\n\tTue, 15 Jan 2019 14:27:29 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547558849;\n\tbh=99nBO+Ftj75wdX12u9G5qTB/WfBqCX5k8frDHp5PZ1Y=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=OSjIT/WWhres4mnFzJ9Bzf7s/HjLVT7o4Dqhv3hahPj1287LeRYuuPBwk6I+bOtI5\n\tCkdOgy42TRsLwGKmlNmKQtJw+6qmP+ZuXmDzrFojuwnn3cQVBzfA5jg/rzkIFfc/6/\n\tI8YJmqgRh4bX37/NQsLcLY2OOfYetI68lGqbGWi4=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"kieran.bingham@ideasonboard.com","Cc":"libcamera-devel@lists.libcamera.org, Jacopo Mondi <jacopo@jmondi.org>","Date":"Tue, 15 Jan 2019 15:28:45 +0200","Message-ID":"<2066264.TPJSTNnpJ2@avalon>","Organization":"Ideas on Board Oy","In-Reply-To":"<c6769cc5-b9fb-9bbb-24fc-bdfd83221858@ideasonboard.com>","References":"<20190111160737.25094-1-jacopo@jmondi.org>\n\t<3383522.SeLiCC3bgp@avalon>\n\t<c6769cc5-b9fb-9bbb-24fc-bdfd83221858@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"7Bit","Content-Type":"text/plain; charset=\"us-ascii\"","Subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 15 Jan 2019 13:27:30 -0000"}},{"id":316,"web_url":"https://patchwork.libcamera.org/comment/316/","msgid":"<3618646.Nnfxf9kDz3@avalon>","date":"2019-01-15T13:37:25","subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello again,\n\nOn Tuesday, 15 January 2019 15:28:45 EET Laurent Pinchart wrote:\n> On Tuesday, 15 January 2019 13:00:50 EET Kieran Bingham wrote:\n> > On 15/01/2019 02:02, Laurent Pinchart wrote:\n> > > Hello,\n> > \n> > <snip>\n> > \n> > >>> -\tif (pipe->match(enumerator))\n> > >>> +\tif (pipe->match(enumerator)) {\n> > >>> +\t\tLOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n> > > \n> > > And removing the \":\" here too.\n> > > \n> > >> (not for this patch - just ideas out loud)\n> > >> \n> > >> Can/Should we make a function/macro called\n> > >> \n> > >> \t quoted((os), (_s))\n> > >>  \n> > >>  which will do:\n> > >>   os << (\"\\\"\" << (_s) << \"\\\"\")\n> > > \n> > > I suppose this would be\n> > > \n> > > #define quote(s)\t\t\"\\\"\" << s << \"\\\"\"\n> > \n> > Ah yes - I was overcomplicating already :)\n> > \n> > >> LOG(Debug) << \"Pipeline handler: \\\"\" << name << \"\\\" matched\";\n> > >> LOG(Debug) << \"Pipeline handler: \" << quoted(name) << \" matched\";\n> > > \n> > > Wouldn't it reduce readability by hiding a simple construct behind a\n> > > macro\n> > > ? I know it's tempting to avoid writing the escape sequence...\n> > \n> > Does it? I guess it's subjective.\n> > \n> > It is a simple construct yes, but IMO the escaping of the {\"} hinders\n> > \n> > readability more. A quick glance here:\n> >   : \\\"\" << name << \"\\\" matched\n> > \n> > could look like we are sending the string\n> > \n> >   { name \"\\\" matched } as if it was a path with backslashes or such...\n> > \n> > (Yes I'm aware that the example above is taken slightly out of context,\n> > and it was done so purposefully to represent 'a quick glance')...\n> > \n> > \n> > Also a helper here would ensure that quotes are correctly terminated, as\n> > demonstrated in Jacopo's patch f1caaaf387 (\"libcamera: Debug printouts\n> > fixes\") which adds in a missing final \"\\\"\";\n> > \n> > +\tLOG(Debug) << \"Successful match for media device \\\"\"\n> > +\t\t   << dev->driver() << \"\\\"\";\n> > \n> > Although in that particular case - I think that log statement could have\n> > been on one line where it would then be more obvious too.\n> > \n> > \tLOG(Debug) << \"Successful match for media device \"\n> > \t\n> > \t\t   << quoted(dev->driver());\n> > \n> > Anyway - it was just an idea/suggestion, I'm not tied to it ...\n> \n> If you submit a patch I won't reject it :-) I would however prefer a\n> function instead of a macro, in order to avoid claiming such a generic name\n> in the global namespace. One option would be, in log.h,\n> \n>  \tLogSeverity severity_;\n>  };\n> \n> +namespace log {\n> +\n> +static inline std::string quoted(const std::string &name)\n> +{\n> +\treturn \"\\\"\" + name + \"\\\"\";\n> +}\n> +\n> +} /* namespace log */\n> +\n> \n>  #define LOG(severity) LogMessage(__FILE__, __LINE__,\n> Log##severity).stream()\n> \n> (Whether we want a log namespace there is debatable). The function would be\n> used as\n> \n> \tLOG(Debug) << \"Print a quoted \" << log::quoted(name);\n> \n> I haven't studied whether there could be efficiency concerns due to string\n> concatenation.\n\nI forgot to mention that a simple solution to all this could be to use single \nquotes instead of double quotes.\n\n\tLOG(Debug) << \"Print a quoted '\" << name << \"'\";\n\n> > >>>  \t\treturn pipe;\n> > >>> \n> > >>> +\t}\n> > >>> \n> > >>>  \tdelete pipe;\n> > >>>  \treturn nullptr;\n> > > \n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 44C1460C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Jan 2019 14:36:10 +0100 (CET)","from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6A69A4F8;\n\tTue, 15 Jan 2019 14:36:09 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1547559369;\n\tbh=ffbX4FsLSZAB0Ofl7IVgUvp+721d/XjGn8BsOQ678l4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=OybtQ4cgkfAK27ROGsk3bEnEikXmw2fbh1I1EOTK9KjJe0Yak6nKSA5TNc82LkzJQ\n\trPlugvMUVHWOaCQjwX1aR+dkfAhbAYyGjWNQ2mNh+0ObWp7nK8II5O2BaGj6TR/+30\n\t9oMQuqt5545ngCTVSTeIERoExxMu53Rs+ZqBM4VU=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 15 Jan 2019 15:37:25 +0200","Message-ID":"<3618646.Nnfxf9kDz3@avalon>","Organization":"Ideas on Board Oy","In-Reply-To":"<2066264.TPJSTNnpJ2@avalon>","References":"<20190111160737.25094-1-jacopo@jmondi.org>\n\t<c6769cc5-b9fb-9bbb-24fc-bdfd83221858@ideasonboard.com>\n\t<2066264.TPJSTNnpJ2@avalon>","MIME-Version":"1.0","Content-Transfer-Encoding":"7Bit","Content-Type":"text/plain; charset=\"us-ascii\"","Subject":"Re: [libcamera-devel] [PATCH] libcamera: Add debug printouts","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 15 Jan 2019 13:36:10 -0000"}}]