Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1177371ybl; Thu, 23 Jan 2020 15:14:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzkDaaqpXpGrC2acLWxKHqsunauPTogqB9bCnXqpwG1juZeIZTzBIrLCbxQPwrDxUVATsXS X-Received: by 2002:a9d:6b12:: with SMTP id g18mr571951otp.211.1579821277819; Thu, 23 Jan 2020 15:14:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579821277; cv=none; d=google.com; s=arc-20160816; b=vlCEsH7KOZ3z8OZ12cX9bWuj0sJF+6ggIMZYgFdTl3cPUQB/nZc5JkZnyahH0kh8M2 WbDlIC04zfuip+NHDn7NZlB9jJuR2pZVQgp5QWxE9JYtuycg/KYBF2zaSirG7CRTa0I/ kIeCFfU/3p3a7C7CchVXKPsyisN9q0zUxcaqUhGQJNo2K1usCLKjp4pqs1434hzVfkfw U2RsJfci3b9EcggCZeQDAqI2EN7F6sv01SqACU6bPwt2WftVXbNoByeXhNsbK+Bfx/dy xYrzn989GHIpJO0l8QawIYZFGSkfKldB3qFaFMvtNRKkkH1rpvlYiI3Pe2QxSw3HVOt+ 3PjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=jfZ6PqzdY3UJ50IFdqGJ0SYi6XBLrvXzq1DVeJ23b24=; b=alRRzlHaE1QPZqXhZDWOhoUm2q63QVxDVkyXvE760uclvfgN63ufIj2LI85HnVZgC6 oF0uaiLcqFE27uaZUm0POJBgSMtYJBVlD7sgmz7rj+zhMu0mcafUCvzsprSb+/eOHFRp hWEY+ir2KGxWgjld8o3jbl/DrfTV3oApJS1pTqDjMilUA/7m9D8Uql07Jz3G73ItK3k7 pvrJt7O8q7sxZbpoz4VfiFrT2vLCnEye/sek3XlFnMNvI4bL+deV0EkRKDM2Al0XdU2U UWRwwzdhHjBa6VLRtrWhOXjDpDIiKrQ/n2DZHIrZTP5v5pcwZXI9fW6419jf2zrOHNYX E2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SaVwgSuA; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si1493264oic.274.2020.01.23.15.14.05; Thu, 23 Jan 2020 15:14:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SaVwgSuA; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729259AbgAWXOD (ORCPT + 99 others); Thu, 23 Jan 2020 18:14:03 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:38901 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729546AbgAWXOD (ORCPT ); Thu, 23 Jan 2020 18:14:03 -0500 Received: by mail-ot1-f66.google.com with SMTP id z9so4513124oth.5 for ; Thu, 23 Jan 2020 15:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jfZ6PqzdY3UJ50IFdqGJ0SYi6XBLrvXzq1DVeJ23b24=; b=SaVwgSuAuPTqztpD/q/4goKm5RR45Be96i5EH1LJr+SJe5JgOejN3gye/oR0lT3dna k8WE99Tgy7Ln4SDTUV6j2B1pfCR2Zd4+Ot9s1pnr9cBk+MXX9LtaqZc+a3gkpDKmvZiy vCUkMjYvf1CgT49Z6YBFp50H3y2qVmGSGi/F4Yw3I7QFch8+VcTwJ5ngRYrqK+HOzK04 qMYnW4a8gR5/vJezO8SpV6+9TNmCPLJUaCGz58xdln8CzxfWNUT9PlgqKNtCHZvRL0tq oNqgKH48N8JEjss7G1Rz2B+fcqD57N4wH1eF0Mt3+//uJ0oNPojTgbEPeD8soavJFMHU ZZwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jfZ6PqzdY3UJ50IFdqGJ0SYi6XBLrvXzq1DVeJ23b24=; b=hVdc1hkrQDKNikgcG8I8T7B1fZyRsGXPOVcX0tKADODen/h//kRarODWrSmEMzYEzS T9fIU0+i+ZSwUgydxRuqkRsdrBJDl3MHDGwO5qRoKhF8ANrnu+4+sSkEYivBBWM2yvG1 6CcvPW0feK6Dp1tqqcrQJ5pQ1GFfM/9b/H6L6UNp65+5pTTXvJ55Eqsii2K4L+pYR4GU 90jegUrZzkhbOyVWXHfssl92GIy+vZovaO3fwb1G3r2ZAzQzHsuJ1vI0Wqoc6BYlHE1S 4iO/J4A7DTWKOm6whTMjv5a4m5kykid+2oNP+urjtafkMHFWTKjSLmhr6yW6jU6orccU UTvQ== X-Gm-Message-State: APjAAAXTfAxgqax8bOldi+m5xt8JnO3Hnm96vmhKVp+TToWu5WDmMGf2 mKXx1V3NNC0sgslj/CZd3jtbZKkuO75lOShyuMk= X-Received: by 2002:a05:6830:1515:: with SMTP id k21mr561871otp.177.1579821242664; Thu, 23 Jan 2020 15:14:02 -0800 (PST) MIME-Version: 1.0 References: <20200120202708.111383-1-alainm@chromium.org> <6E55772A-01D5-4616-B3DB-CC22B935C855@holtmann.org> In-Reply-To: From: Luiz Augusto von Dentz Date: Thu, 23 Jan 2020 15:13:50 -0800 Message-ID: Subject: Re: [Bluez PATCH] doc: Add definition for Set Kernel Debug Level To: Alain Michaud Cc: Marcel Holtmann , Archie Pusaka , Johan Hedberg , Alain Michaud , BlueZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alain, Marcel, On Thu, Jan 23, 2020 at 10:20 AM Alain Michaud wr= ote: > > Hi Marcel, > > That makes sense. Adding +Archie Pusaka as well who may have input into = this. > > Thanks, > Alain > > On Thu, Jan 23, 2020 at 1:16 PM Marcel Holtmann wro= te: > > > > Hi Alain, > > > > > From a high level, this looks good for me although I agree, this is a= n > > > order of magnitude bigger in terms of scope. Can you suggest perhaps > > > an interactive way to deliver this over a period of time, perhaps > > > prioritizing the BT_DEBUG kernel messages first? :) > > > > I am always in favor of increasing the ability to debug things, but we = need to do this in a clean fashion and not some short term hacks (since the= y will come back and haunt us). I like to get some review on my idea first. > > > > What we could do is work on the BT_DBG etc infrastructure to allow swit= ching when dynamic_debug is not available. Then you would use some debugfs = toggle in /sys/kernel/debug/bluetooth since that is no stable API for us (a= nd of course the clear understanding that this toggle is temporary). > > Not sure if I fully understood the problem, so I guess we are looking to a solution to replace dynamic_debug since that is not normally enabled on production? Not sure if this should be discussed with kernel community as whole because it does lead to each subsystem reinventing their own mechanism of logging. Now logging the kernel message into btmon I thing would be very useful, regardless on what the mechanism would be used to enable them, so perhaps we should start with that. I fill that enabling the exact same granularity as the dynamic_debug has would be a bit overkill so Id would suggest sticking with the current categories that we have for the monitor which are: #define BTSNOOP_PRIORITY_EMERG 0 #define BTSNOOP_PRIORITY_ALERT 1 #define BTSNOOP_PRIORITY_CRIT 2 #define BTSNOOP_PRIORITY_ERR 3 #define BTSNOOP_PRIORITY_WARNING 4 #define BTSNOOP_PRIORITY_NOTICE 5 #define BTSNOOP_PRIORITY_INFO 6 #define BTSNOOP_PRIORITY_DEBUG 7 Though I see Marcel's point that if we go this way enabling DEBUG level would simple flood the trace, but I believe the problem can be solved with a minimal change which is to split data (above L2CAP/RFCOMM) and signalling logs, obviously this would require a spit on the way BT_DBG works so we can actually say dump the data path or just the signalling (this should probably be the default), which I think would benefit us even in case of using dynamic_debug because depending what files are enabled (hci_core.c, l2cap_core.c, etc) that logs way too much and it is not uncommon to lose the logs because the terminal buffer is not big enough just because the data is intermixed with some signalling, that said I think we would have to prefix data and signalling with some string and then use format option to match them. --=20 Luiz Augusto von Dentz