Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1324911pxb; Thu, 4 Mar 2021 08:32:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzb7N+q+rbqFQEYAX5JOEY3qeS3xdpozYT4VGmArXmoEhtuHXYp5VU/At8Iy/WbqGt4hdE4 X-Received: by 2002:a17:906:3750:: with SMTP id e16mr5143309ejc.75.1614875521861; Thu, 04 Mar 2021 08:32:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614875521; cv=none; d=google.com; s=arc-20160816; b=PC8ylnJdApcQkh/Ws/uVFNeIjQqnz8VoAvNlejGk+24Xw80cGRInqdu7v8F09DJkkP 0vyEqXm0doSvUHKcLYqiduR48unBMKJiOBuHz9Z78VpcetTHiaDwLvikHgVBkifos9pw vWWYI9cz6tkyUIu0B7jJHQuIGqGS4eS2GjTgZVH7WwHXQSnPgDV2AVhgIoWdj56fiKpK 3ISSvlfb5xYAWnaDF7Lq0BfzXHQzx+AQ/yfL8T/LmOCSARnyblZUGxBVMdV2MxXxmBEM do+r5G0b8bZUjd+EpcswgBP6zSYOVmRxWu0BvqgCjTL5zEFHycyM3WoxVjgtjuTP+1Vv WzfQ== 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=vj7crQv0RBsiX1DUBa7jbsdhS16ZuGDUR9megRQZGoM=; b=0RwObQ9wFh60lWDII16PQ+UMHOGVhp05dVeqkQfKVilYqt069Mfct9SwOLnjFsMleF mkod3xACqhP2PTevAWzh4nosidGOCx8GHmbf/C6RyTbrpA8mhCjHFs/uEniB9QIHo1uR 67gvzYcGfOs3p1138QEYgVhcY/n4c21u5XuI2D//V3+NoJM5K84IGrsZSXvcnqc1upal JRVAcs86yzlsckZtnPTb5JygTDceIRTfGHwXevvTr44H0J5gUbnCIIrkbZ4VZC6Ldxht 7GFSA/0pNa+Nc2v5tqQPJ6p/3idcjwCpmhhkmRMM+Z6sbWcwfD0rPsxv5BYsbXPEBqJ+ mOOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w2oE41WX; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si19380523edj.528.2021.03.04.08.31.38; Thu, 04 Mar 2021 08:32:01 -0800 (PST) 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=@linaro.org header.s=google header.b=w2oE41WX; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239200AbhCDK7n (ORCPT + 99 others); Thu, 4 Mar 2021 05:59:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239226AbhCDK7m (ORCPT ); Thu, 4 Mar 2021 05:59:42 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0189C061756 for ; Thu, 4 Mar 2021 02:59:01 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id e7so42495311lft.2 for ; Thu, 04 Mar 2021 02:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vj7crQv0RBsiX1DUBa7jbsdhS16ZuGDUR9megRQZGoM=; b=w2oE41WXVFCbvUlqrjhtMX4NdYb/PFCtelM1C2k7uR2Udy/zt8bsV0rHcfy+kIcU2G lB43OWqmPv8KG9C/LljFhZ/C5RMEkY5VRlmp0fwLSwkVdN5B/hMs/KMaKuKMIKjWWpQi OF3FwBZ+0gxJf7V96KnH7t5iKJ21mtWYrNwJK6v0cgg85MpcLcjH2rURuZdP9NxameRf QrktBeg7pGgG9zXwGwWF4T87imCTpca+Zqn2DEneBXwPCfONiEiNQL+jkdvpTonIjQPF IieTtVeBdUK+5VLNLLqFiYgFq/99KXtnFlOUNSv1O0mEBztHtGyREGI1uTbvQgecgP6i AzmQ== 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=vj7crQv0RBsiX1DUBa7jbsdhS16ZuGDUR9megRQZGoM=; b=Cj5evq5WNdw0zuahT78TbbNLg2dVYHUQGY3cTTWkKXCut0C6iKaAxF/hGtiI1cvn51 79reaYpsc4qiYqCPas0yUaGRTqAscdiJMxDxMReOXcz+bdEN6GVEeAtXqdyBRso6TLDV Crr1PHkzBvMF7X0gtqrMylcdnuPbE6VVB+m988u9TwHWog8INVeqVyno+kgEEcz7hqay dC7dqiRLx9PM0Ai3gy0uVbAytRrzGcXxz/tz5lG7ZL5va/7YoDih45ZaiKCWH/sZ2IO7 Wixgca4S9weV6aa4CCFLUL7rlab2OBmRhhQ0uBeixZD/pt7Lct8bknmTjrjHfll3ICtG 0rZQ== X-Gm-Message-State: AOAM532hzegmKHBqupLisl2iWpCvVWjaLw7MAPnarNTF5xeOq0XrDcWZ WZpZ7A8fYw782WmDBiyFbdRtrB6kZlnw1gjBmBS42A== X-Received: by 2002:ac2:46db:: with SMTP id p27mr1953927lfo.396.1614855540297; Thu, 04 Mar 2021 02:59:00 -0800 (PST) MIME-Version: 1.0 References: <20210224070827.408771-1-sumit.garg@linaro.org> In-Reply-To: From: Sumit Garg Date: Thu, 4 Mar 2021 16:28:49 +0530 Message-ID: Subject: Re: [PATCH v5] kdb: Simplify kdb commands registration To: Doug Anderson Cc: kgdb-bugreport@lists.sourceforge.net, Daniel Thompson , Jason Wessel , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Doug, On Tue, 2 Mar 2021 at 00:10, Doug Anderson wrote: > > Hi, > > On Tue, Feb 23, 2021 at 11:08 PM Sumit Garg wrote: > > > > Simplify kdb commands registration via using linked list instead of > > static array for commands storage. > > > > Signed-off-by: Sumit Garg > > --- > > > > Changes in v5: > > - Introduce new method: kdb_register_table() to register static kdb > > main and breakpoint command tables instead of using statically > > allocated commands. > > > > Changes in v4: > > - Fix kdb commands memory allocation issue prior to slab being available > > with an array of statically allocated commands. Now it works fine with > > kgdbwait. > > - Fix a misc checkpatch warning. > > - I have dropped Doug's review tag as I think this version includes a > > major fix that should be reviewed again. > > > > Changes in v3: > > - Remove redundant "if" check. > > - Pick up review tag from Doug. > > > > Changes in v2: > > - Remove redundant NULL check for "cmd_name". > > - Incorporate misc. comment. > > > > kernel/debug/kdb/kdb_bp.c | 81 ++++-- > > kernel/debug/kdb/kdb_main.c | 472 ++++++++++++++++++++------------- > > kernel/debug/kdb/kdb_private.h | 3 + > > 3 files changed, 343 insertions(+), 213 deletions(-) > > This looks good to me, thanks! > > Random notes: > > * We no longer check for "duplicate" commands for any of these > statically allocated ones, but I guess that's fine. Yeah, I think that check is redundant for static ones. > > * Presumably nothing outside of kdb/kgdb itself needs the ability to > allocate commands statically. The only user I see now is ftrace and > it looks like it runs late enough that it should be fine. Agree. > > Reviewed-by: Douglas Anderson > Thanks, -Sumit > > -Doug