Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp997830pxb; Fri, 13 Aug 2021 10:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhdG3CkzGHF8Yac6nyR84p/1dWcKXelNyGcWv5AL+jBK6blpgPoqWaDoTZLtBXE/GAK4Mk X-Received: by 2002:a05:6402:1d84:: with SMTP id dk4mr4639359edb.114.1628877395403; Fri, 13 Aug 2021 10:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628877395; cv=none; d=google.com; s=arc-20160816; b=ly/gS98UQTVAhCuEfuJVtOIPTlQAHqVE4efNfR89iaLb/JlsfZzrGPfXRcvKeDMFId AY3DVqvNQbWftAhxp0+/dL/AnyJr7Rw8qoN+tNI8+ZYXZlyl34krE2jkZZppkfhOqi6k Eq603JL4RT5einzRckkpv/EZn7v1d6NiH1hd1Pw/GVL48ZRFTF0Lg+6zrzh5hC87o2Dz fjpA7TBrg/Mfg/XS4q3HhNvexFlJnzuUFnJt4IINhSfk4AVxDUHyr+vaRWlpkMb/L2Fk ngjXPU497/cWw5vEYNsN/2HzKlZonAGRZ6NRzWJOM23a/YpRvY4EQ1H3M7DMy000DCkF bX4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IBpWJjn84n0VTFtyOrHeTuSf3jIt26LKBlRRRr/JZ/Y=; b=gWfy5nmmyni5HtoqhiukVM79/rRJU5+BG57qW63oj73Oi8ZXgeC0ZTPTesspIs2imC bcgK8NwovTyKMm50r+i0MeT7dVIzsn1gIN8taRtJV2NG/08O61JqYE/W7wIoFtWdutj6 o3gKDMjuZHs/kllPA0et0ZBn0xkKkoub25Q6vCMD4fZZB+SZ3JMBIVFl6JpsnmdyHufV hMmqx/+vospgWDMlB1/ZAkAH6GoXyJL03YqhUDarlZP10pUOVXoX2+7TyahmlrLWGFQd 9Fb9fYlfk+4/OSo76f3W4oGPMrq+kY+tIi2KMRzVM0kk0CpvidM+6dCuc1By0BDhW2Nz RrmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pUH01TKo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x2si2910870ejy.385.2021.08.13.10.56.11; Fri, 13 Aug 2021 10:56:35 -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=@gmail.com header.s=20161025 header.b=pUH01TKo; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229952AbhHMRuz (ORCPT + 99 others); Fri, 13 Aug 2021 13:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbhHMRux (ORCPT ); Fri, 13 Aug 2021 13:50:53 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BAF2C061756 for ; Fri, 13 Aug 2021 10:50:25 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id d6so16554321edt.7 for ; Fri, 13 Aug 2021 10:50:25 -0700 (PDT) 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; bh=IBpWJjn84n0VTFtyOrHeTuSf3jIt26LKBlRRRr/JZ/Y=; b=pUH01TKoDh+E8iipMmLUDmQY9M36LVOXuT/+IEuhsLjS2JAgTbwJiUIuiZ5d00CkLf 4bTS3iE86wJRPh+spU2w4CaQWM4mqMyImn6LT4RBxY6JgefFYyr8x+xTfPGHVQx2ohUM cFxPvA3k+DQSL2Ls4YFSa7e+vpK1bh3QcFV0oS6bOfIpqf3sfAEQ4AvIgkfCUmk8ryfi kMR9rmsjTqfgs+4f4mvDPZnwCsy7OIq1GCTg/H5WFfFiKnaua4+1L5az5OeeGAPlMrFw /lqPVm7oOwjQp8pUVkm4HrV3a64+puqik/kbuIoIaUbwu+53GGHl6nlXYUMSQSR4s2Br hf4A== 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; bh=IBpWJjn84n0VTFtyOrHeTuSf3jIt26LKBlRRRr/JZ/Y=; b=m2fHtDmXsFzMdevGiJpKMb2+AiCbyKHaGyzH9dpxyBYqhJslcMjXE1yr2U2JvDE2CF aq3TUlVcD5giOHZDH6mxMwNpuWDZratNuYP9MyPGGJcGuabsJt8vQn+w39VhmzloU5gE wydYSx0cMGnI/lFF5eQlvwiJUbFdzn7Z7EKBXo6lYXB/cWWFo2GKeN7VnZs9zasdY9rr yUnNfzqmzjB+wsZ22fH+4GYuCQhgtwd5KttKswW4Tq+epqjW61Tz0GxM1Yox/7e4p7Nb s3ehz9OsdSLpyEpxnqK93W4zY4kSwNydHjPLm3KOfmORYvvh6tE/6ztdD3gLzAgOg8MQ ROXA== X-Gm-Message-State: AOAM531PzeY594HUgKM9YZwaBfUNwKBaZx/HLQCTSh60LMlu3GRUlI6o RVND28zFdTM/R0YwR8l3usdU+fxSIHzZ4PTT/c4= X-Received: by 2002:a05:6402:31f2:: with SMTP id dy18mr4581611edb.267.1628877024028; Fri, 13 Aug 2021 10:50:24 -0700 (PDT) MIME-Version: 1.0 References: <20210813151734.1236324-1-jim.cromie@gmail.com> <20210813151734.1236324-4-jim.cromie@gmail.com> In-Reply-To: From: jim.cromie@gmail.com Date: Fri, 13 Aug 2021 11:49:57 -0600 Message-ID: Subject: Re: [PATCH v5 3/9] dyndbg: add DEFINE_DYNAMIC_DEBUG_CATEGORIES and callbacks To: Andy Shevchenko , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > There is still plenty of bikeshedding to do. > > > --- > > v4+: > > > > . rename to DEFINE_DYNAMIC_DEBUG_CATEGORIES from DEFINE_DYNDBG_BITMAP > > . in query, replace hardcoded "i915" w kp->mod->name > > . static inline the stubs > > . const *str in structs, const array. -Emil > > . dyndbg: add do-nothing DEFINE_DYNAMIC_DEBUG_CATEGORIES if !DD_CORE > > . call MOD_PARM_DESC(name, "$desc") for users > > . simplify callback, remove bit-change detection > > . config errs reported by > > > > ddh-helpers > > > Signed-off-by: Jim Cromie > > So, it is signed or not? I didn't get (perhaps due to misplaced changlog?). > It might be my --- snip, and reliance on format-patch -s would it work if I used -- 2char snip ? > ... > > > } __attribute__((aligned(8))); > > > > > > Do we need two blank lines here? > > > +struct kernel_param; > > ... > > > +int param_set_dyndbg(const char *instr, const struct kernel_param *kp) > > +{ > > + unsigned long inbits; > > + int rc, i, chgct = 0, totct = 0; > > + char query[OUR_QUERY_SIZE]; > > + struct dyndbg_bitdesc *bitmap = (struct dyndbg_bitdesc *) kp->data; > > So you need space after ')' ? > > > + rc = kstrtoul(instr, 0, &inbits); > > + if (rc) { > > + pr_err("set_dyndbg: failed\n"); > > > + return -EINVAL; > > Why not to return rc? > > > + } > > + vpr_info("set_dyndbg: input 0x%lx\n", inbits); > > + > > + for (i = 0; !!bitmap[i].prefix; i++) { > > Hmm... Why not simply > > for (bitmap = ...; bitmap->prefix; bitmap++) { > > ? > > > + > > Redundant blank line. > > > + sprintf(query, "format '^%s' %cp", bitmap[i].prefix, > > + test_bit(i, &inbits) ? '+' : '-'); > > snprintf() ? > > > + > > + chgct = dynamic_debug_exec_queries(query, kp->mod->name); > > + > > + v2pr_info("bit-%d: %d changes by '%s'\n", i, chgct, query); > > + totct += chgct; > > + } > > + vpr_info("total changes: %d\n", totct); > > + return 0; > > +} > > ... > > > + return scnprintf(buffer, PAGE_SIZE, "%u\n", > > + *((unsigned int *)kp->arg)); > > One line. > > -- > With Best Regards, > Andy Shevchenko > >