Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp547436pxb; Wed, 3 Mar 2021 09:17:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7P5LqVHBDEcmqhupwd6CLVSgGZroIVX4ZzXFZkVwN0L3iQtO7ifqV+/yQkQgQ1/Zx/o+1 X-Received: by 2002:a17:906:4d96:: with SMTP id s22mr20610202eju.189.1614791855000; Wed, 03 Mar 2021 09:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614791854; cv=none; d=google.com; s=arc-20160816; b=KD0UsG6UTqLT4ZVpJgZbC4NE2aQSHYc0bjE+uKgimCNYG7qxRVVdIMC0Fan1WsU7dA rCN6hBNdulvGA7QUof5h4AOwMqSmFMi4WsulZ8XMFq8QiJ9S+85cpRWrE9bgfnoCCwFF Qh0lVp9SQKNEOoakuO3wqkpRYw9IVvNkhCPZN8V6f+wq2CDGOK1r1lwpg66a33I8M0oT FbcicHLuNPAiVxc2LJKLoeBE2nz5E8EP1WK50FGqDbO+Qv39DTT/OP1g+ZDpYmAGXgpu +0Dn4mnoLuUdGLURMMPbbMy20VNF28fNEvPX4zTAh2n1BMK9bIC+mBwyXvJDOpRyzGyB +0wQ== 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=gkLZdNbvLFDlwE1SwAhQ+C2mF/JHbfuAJhOZU57wMJ8=; b=ciZfHzBf7RtWAfvcn3mbYmVwbeF3ZYabiUtUXTJ1Pxsbm4uIvoSNPaF+acWWqivWEA uTMsWSH6ZHafFTNGYQTQBrOW99DM3HJ61rX1PDHuCGocgp8v1anm0Lnq8dnnPeTx87EV pH8j83emeFLwSQOcnYncR5DSYunNmn2iyWUNEITQcuwENawIXLCrMGNWWVSt63lcqH9A tv2dJlRvuPzyRkacm+bXJKBEBTPiBbnZw9H47mmFhsamHaIcohoBxU6rt9qVXOaz4YRS L6u9zPx55oT9AtCLyIwt5RrW1Ly9Fdt9wPo7rpyci+vUN2phGpTKA75yo/V0HGrVQYoa 8t2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TeklHcLC; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl4si15116734ejb.691.2021.03.03.09.17.08; Wed, 03 Mar 2021 09:17:34 -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=@chromium.org header.s=google header.b=TeklHcLC; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377291AbhCBAqd (ORCPT + 99 others); Mon, 1 Mar 2021 19:46:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240074AbhCASll (ORCPT ); Mon, 1 Mar 2021 13:41:41 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3F5C06178B for ; Mon, 1 Mar 2021 10:40:54 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id b130so5977214qkc.10 for ; Mon, 01 Mar 2021 10:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gkLZdNbvLFDlwE1SwAhQ+C2mF/JHbfuAJhOZU57wMJ8=; b=TeklHcLCVQd59aWhG3y1h8Ry46VzF/QVz8mHAhk9QIno7HKuUcNcrOnxnA0jwfhEwL WL4DYrs3a4eJIIVAUnHHLF9KTQV7/ztyskEV1PELfHyB4Sd8Hm2+QcxHf8olsG+anMG/ V9SLfZXBwuBRSsDn/BMHyRPogaOjl93GoUKBA= 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=gkLZdNbvLFDlwE1SwAhQ+C2mF/JHbfuAJhOZU57wMJ8=; b=FHIS5je/FUlfkYUKkavboMZdHb5o/bvPqZsEcfu9VWtkdeVVRym7pGJMhX8mCv4sik cxAtPR5bmbkNkLGbHSya7W5Eonhl0jo1PMQBO02qaCC8Z0fD+ryXo4XI6J/T/ivnHk9V +UrOgLfvRr4tSdYNobiNUG5mLYjn6egPG7N7SZwgCLKJ+Laz9CJ3pSCIYywilbyaviOP UvaFGyKIXVvZ8IHSXBxYyVBz4iGs+JvKzS+tzL68JTEYJ6QFOvFPHlezPJYtuZxDnFp+ D+0N/6R+E8MP3TuH7FtAvUwVzLzY8fEYYEt5UHFV7FbHfRYlf9thoASeREujwZXBC4x/ pCfQ== X-Gm-Message-State: AOAM531lU9pjepncujVBjzQpSBNVLU+ZEesJSY6U/R6xAuJZzABiQLtD QjH7y0Qg7vUlhGbdY6venX2eKV9GVfi5Zw== X-Received: by 2002:a37:af83:: with SMTP id y125mr15509195qke.210.1614624053822; Mon, 01 Mar 2021 10:40:53 -0800 (PST) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com. [209.85.219.173]) by smtp.gmail.com with ESMTPSA id l6sm3033816qke.34.2021.03.01.10.40.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Mar 2021 10:40:53 -0800 (PST) Received: by mail-yb1-f173.google.com with SMTP id m9so18002661ybk.8 for ; Mon, 01 Mar 2021 10:40:52 -0800 (PST) X-Received: by 2002:a25:aa43:: with SMTP id s61mr26388944ybi.32.1614624052460; Mon, 01 Mar 2021 10:40:52 -0800 (PST) MIME-Version: 1.0 References: <20210224070827.408771-1-sumit.garg@linaro.org> In-Reply-To: <20210224070827.408771-1-sumit.garg@linaro.org> From: Doug Anderson Date: Mon, 1 Mar 2021 10:40:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5] kdb: Simplify kdb commands registration To: Sumit Garg 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, 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. * 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. Reviewed-by: Douglas Anderson -Doug