Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp72784pxy; Tue, 20 Apr 2021 12:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwueg87S134qSXk0OAiLPt0XO773PNuzodOYp++6jLLMb5bn/aGlBjVnb3DOcuwdx538nCR X-Received: by 2002:a17:90b:120b:: with SMTP id gl11mr6734596pjb.143.1618948672382; Tue, 20 Apr 2021 12:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618948672; cv=none; d=google.com; s=arc-20160816; b=bRtNsHetmYIvBSglm4BDmrnfa6jVgtVGjfwXuYDkmjmuf6qWpEMcdt5p4gh9Tou3YG yS3+ky/KRAnw724JH9wpDmnHQxWJUx++quziLh2WL3Q/b9vOjXtzkUwPEnL25azWOGYG QYKYfYlun9NYlXUfpYyi+nlXdW8HoBqf1SWobbBBlkix5H/lK8hJdeEC2uV1g8R0v23B n74eNX+b6/IANpQD60KtrJDPm8hdRt0FED+L8Gw2W4Q6xUJrjhE7VX5FVenQAuLVJi3P cX6idetfOuX6CLjo1faOduowQBM05es8IMpEgsT+yYv6R5XHq0RzBluRYXXEq73UuYrm Pz8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uFNFpoRS03g7XkmkDpfCAdqtLSbNnkUok6vdGzxiXNM=; b=Ef7ls69Ty/2U/56b+cHw/q7Nw5tng+xIycafYOFLHwcNxfXtxQFEVOKFu5YOhL9K7f hw7V/nf8BvCeitQz7+4S96ViXqZkcsoF5CKVKHv9NKZXnQh9DxnsBrbmA/GwOQcdcDNQ m1opgDtwuOIl88jyOreLJ8ntvm1eLKIcgeGkgLQq+hbODA2DwerEq8JZE6AzkzbzKsI+ fZfTKvnW35/b9wep8WpwPQbfsqRKBhOk7sR6SRLMnkjP25Crn+3qDgHnGSBqCBjlLv8J JyAPoxB+qvDK1lXfWbIvtGucmpND8WD0LRphY2j3K+ehtzYKCN2hnZYxRjeaanisJ+Xi X+QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=abR+4j0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si25480165plk.261.2021.04.20.12.56.55; Tue, 20 Apr 2021 12:57:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=abR+4j0H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233750AbhDTTzV (ORCPT + 99 others); Tue, 20 Apr 2021 15:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233541AbhDTTzV (ORCPT ); Tue, 20 Apr 2021 15:55:21 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6DCC06174A for ; Tue, 20 Apr 2021 12:54:49 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id l4so60048802ejc.10 for ; Tue, 20 Apr 2021 12:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uFNFpoRS03g7XkmkDpfCAdqtLSbNnkUok6vdGzxiXNM=; b=abR+4j0Hp863Nv20sJiBEsta4XfCdw4vdOQTbfb2O4gprLBCq7hkbRJOAabiMU+u5H kG6JAI6Q5ncIBm16UFa19SKi1QjS9sD2hxOqYG9MacxjhnHkcPIV41611MhHDxzVTFpo /FO8Y4r2vnqdWNAhL48FZ+5oJK7RsM0uMuEdHPa4fGeqM9rI2u7Um1vLdR7Fl88V4Edj ee1BVUL7VgUx8N6JY2jVAK6ODD0CfRoQa3ZbiW1PvQdPhOPAzOUWbQwJludZBmwznRqY J6ll4DAs/PqUY4t9IGhLoL7ATaabzCgTz0x39Ya0XDDjIGbPM6N8Q7xK/2Jsrz2kd5yW I2Og== 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; bh=uFNFpoRS03g7XkmkDpfCAdqtLSbNnkUok6vdGzxiXNM=; b=VfXxpQhJdplqzMiSpAVnEzHOhBGFtquvszAHWHAgD1vOBw0Ik92hDprDcrs30IZC79 wah+GGYFxD36i1XrjqCH42tgVw9gGSQ1G7aO9e47DNEMvbzLowrXAlleMqShbrGh3oXJ jLEuJuYp0bxAH+tmt5VLZy78ScCUDtgcPN0m4sB9shBZ5zKKC3X9wtaHctUe7xpJBuTt sQLTtLsZSakHNFUirtcEXTI+KuOm2pn/IyHQQiwAEiJRqnpLnOvj1lFj+V/obnak/hOj biQa8VyXyr+Ne+18sxUyMP/GhH0OxlX/AwmsBV/EtXul82+EtfxZpLV0tuLXgtPli9JE 9GIg== X-Gm-Message-State: AOAM530wUBJnTxA2NG9OhGPha9m8CqsoAq0aEgV8L/q+K4gNBVEgT1td GTM+tLJP0vnDX9zrXdenZOaQTzErzs+KWW37lLAlDQ== X-Received: by 2002:a17:907:7631:: with SMTP id jy17mr29286875ejc.418.1618948488004; Tue, 20 Apr 2021 12:54:48 -0700 (PDT) MIME-Version: 1.0 References: <1299622684.20306.77.camel@gandalf.stny.rr.com> <877hc64klm.fsf@rustcorp.com.au> <20130813111442.632f3421@gandalf.local.home> <87siybk8yl.fsf@rustcorp.com.au> <20130814233228.778f25d0@gandalf.local.home> <77a6e40b57df092d1bd8967305906a210f286111.camel@intel.com> <20210419181111.5eb582e8@gandalf.local.home> <20210420085532.4062b15e@gandalf.local.home> In-Reply-To: <20210420085532.4062b15e@gandalf.local.home> From: Dan Williams Date: Tue, 20 Apr 2021 12:54:39 -0700 Message-ID: Subject: Re: [PATCH][RFC] tracing: Enable tracepoints via module parameters To: Steven Rostedt Cc: "fweisbec@gmail.com" , "jeyu@kernel.org" , "mathieu.desnoyers@efficios.com" , "linux-kernel@vger.kernel.org" , "mingo@elte.hu" , "chris@chris-wilson.co.uk" , "yuanhan.liu@linux.intel.com" , "Grumbach, Emmanuel" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 20, 2021 at 5:55 AM Steven Rostedt wrote: [..] > > > So yes, function tracing now allows setting a filter to trace only the > > > functions for a given module, and if that module is not yet loaded, it > > > stores the filter until it is. > > > > Ah, thanks for the pointer. So if I wanted to convert a kernel command like: > > > > libnvdimm.dyndbg > > > > ...it would be something like: > > > > ftrace=function ftrace_filter=:mod:libnvdimm > > Hmm, that may not work, but if it doesn't, it would be trivial to add it. > > > > > ...and then "cat /sys/kernel/tracing/trace" instead of "dmesg" to > > retrieve... assuming only "got here" style debug was being attempted. > > > > > To do something similar for tracepoints, I think we still need to add it as > > > a module parameter. > > > > The dev_dbg() filter language is attractive, it's too bad > > Not sure what you mean by that. What filter language. Tracepoints do have a > pretty good filtering too. I'm trying to replicate dev_dbg() usability with tracing. So, when people say "don't use dev_dbg() for that" that tracing can reliably replace everything that dev_dbg() was offering. What I think that looks like is the ability to turn on function tracing by a function name glob in addition to any tracepoints in those same functions all from the kernel boot command line, or a module parameter. > > trace_printk() has such a high runtime cost as combining dynamic-debug > > and tracing would seem to be a panacea. > > trace_printk() has a high runtime cost? Besides that it's not allowed on > production code (see nasty banner), it is made to be extremely fast. > Although, it does do sprintf() work. I was referring to the banner. dev_dbg() does not have that production code restriction. > Would adding automatic module parameters be an issue? That is, you can add > in the insmod command line a parameter that will enable tracepoints. We > could have a way to even see them from the modinfo. I think I had that > working once, and it wasn't really that hard to do. Yeah, that's what you seemed to have working at the beginning of this thread: https://lore.kernel.org/lkml/1299622684.20306.77.camel@gandalf.stny.rr.com/