Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1163023rdb; Fri, 22 Dec 2023 17:56:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE21ZSL5qgvGRpNuGgdte4rbGG3Yanvd7mHhjf7ErHNKQ0lVBXk0KwBbpHhjDQWGMiu81Sz X-Received: by 2002:ac8:4e50:0:b0:423:8e6a:f7a with SMTP id e16-20020ac84e50000000b004238e6a0f7amr3437957qtw.64.1703296613662; Fri, 22 Dec 2023 17:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703296613; cv=none; d=google.com; s=arc-20160816; b=wBNikxZGCHVVEEZtooUgewPAXMV8g731PswKTAAeKEoQf10JeJbzP+LPpjr2mSGTxO tiBeRuWWN22Eq2R2UJWYZhIzIEj0qMA0Hee0ouDfii9KFWmf/YGtzEJee5hIPbCpukNM w+NooD8wYrqt7bTh6XfLjzDf4ct29AfxeP1bAPyrlVGgOQjvaQEXYE+tReXKW8vozMW+ pvbt2kb9X1dW5+gVwh5F1D/F57IiK+C5GTFY5e1yAS1nZMzRS3geqxSvojsXdfmm0tzI ooFsxBieg1WAjAop8Vwl5epA80wT188X87SYhCOyJz4Mts59ibJ79mJXkAmkEfIhIhTG H9mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xrCo62998dd2zdm2uwyLE8Dvl1Erd3p03bl4+A1t0OY=; fh=pC62+Xzu9rWxP3EwkFQHy3M37dHcdVo9RRC56IjE3s4=; b=vgx9DAeCZANJSl3qMNgAWi65uMf4mQ84MYxv7QRsavcvtm0t/uyiCW8X+HFVwZrI+4 mbScOR2zPY4hfDNvpSDG4M1zZZHsSfXcWRCWHCecSaxygu8p/4xUqZ8/h07PU8a0rMeq UPfJIOi+Em8hxluxfo2f4F/brFFUpf91HJXXO1QRD5WKQQYCEa1cJONeI3lV0yc9sswX 4xU0oaAGPwmtW8ue8T0dxptsq7+k6/AoY1/d0oExyiZYXxDw+cN73pGneum3T1kOk/xw FM7XS1L5Gfo6fhZfPB6iLIkbWdjJfloXK2rLBEOHXCQfevr9vyzPQM63rYLFqxyezCyG tPOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=k6xWt0PL; spf=pass (google.com: domain of linux-kernel+bounces-10179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=semihalf.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t3-20020a05622a01c300b00425896deb15si5600485qtw.1.2023.12.22.17.56.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 17:56:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=k6xWt0PL; spf=pass (google.com: domain of linux-kernel+bounces-10179-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=semihalf.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D9CBE1C22F30 for ; Sat, 23 Dec 2023 01:56:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39A6326AFF; Sat, 23 Dec 2023 01:52:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=semihalf.com header.i=@semihalf.com header.b="k6xWt0PL" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B0232421E for ; Sat, 23 Dec 2023 01:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=semihalf.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=semihalf.com Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5548a911cf9so90851a12.2 for ; Fri, 22 Dec 2023 17:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; t=1703296341; x=1703901141; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xrCo62998dd2zdm2uwyLE8Dvl1Erd3p03bl4+A1t0OY=; b=k6xWt0PLaHXRU4zLbVtpgzgCxsmABbV8OQzY3Ab7jVrbrscAyTjT1tfRa9b2a5oXfv jnNnNDo6pqaRyJho1abpDzdCbwbH9YXMNbs1CdLDQNoR1LRWqYrQeWUWCWvvAOMo+ONl cjKNhLDjWKDixD8kAFupL9YrRmvv+3ZCi/LBHvMbItPS3ln+K6IziwCQV7Cqt3VsJqQn MrqFiI+4Qw0CnD1QDdd6EIsYIR+FHveFD5HHGjtia6bHJtHRPML9EyX1w5v3+xuE71iX QDFXuKKEACwwWwOn25hTflkzPV+jUURKltjhuzC3e9CyeW8Y7FdGqsiUdB7WV6gx3u83 OXQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703296341; x=1703901141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xrCo62998dd2zdm2uwyLE8Dvl1Erd3p03bl4+A1t0OY=; b=FE7ihXL+k8fMfcSYHFD2PvKRt2KkSJgMF1LskxFaUobdiKpZXgtruoqJwkn83ap9OV 01rBW/83gCS52nkBayK3EJUtnbB/DHEz5hSttNBg54e3cZehBqNsxzCX8a3WLhr5KO3J A9yUr2pOA1RfZe/vVtIsePdvywJmBWPv3vT6GbyAscIQ1daxn80kmwDMqG7DFrc3OrI2 V0b/NK0lBwqQRsyl+b5ID97Q2IYIjWCM3MJiOQghNy7nLJ3K9hlMKGx9m1MU7KlrMmat CwzqLQtmjAwY5KU2CgcMIRiT8zJcZIIfvJNlnCnaDcwwsP08MXZN/steymrfd4Ymnaqm DHbA== X-Gm-Message-State: AOJu0Yx/JYXIP3u9mzWQbyIFuDCpJhvFGcvHdYHPLgguE4hf5MLztjim Nzd8SL5wkqxmnPXfWb2lCW80VwMPTK4a X-Received: by 2002:aa7:d751:0:b0:553:178:9d5a with SMTP id a17-20020aa7d751000000b0055301789d5amr567885eds.130.1703296341606; Fri, 22 Dec 2023 17:52:21 -0800 (PST) Received: from ukaszb-l.semihalf.net (alfa56.extreme-net.one.pl. [213.77.89.56]) by smtp.gmail.com with ESMTPSA id h2-20020a0564020e8200b005532a337d51sm3288494eda.44.2023.12.22.17.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 17:52:21 -0800 (PST) From: =?UTF-8?q?=C5=81ukasz=20Bartosik?= To: Jason Baron , Jim Cromie , Andrew Morton , Kees Cook , Douglas Anderson Cc: Guenter Roeck , Yaniv Tzoreff , Benson Leung , Steven Rostedt , Vincent Whitchurch , Pekka Paalanen , Sean Paul , Daniel Vetter , Simon Ser , John Ogness , Petr Mladek , Sergey Senozhatsky , linux-kernel@vger.kernel.org, upstream@semihalf.com Subject: [PATCH v3 19/22] dyndbg: add skip_spaces_and_coma() Date: Sat, 23 Dec 2023 02:51:28 +0100 Message-ID: <20231223015131.2836090-20-lb@semihalf.com> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231223015131.2836090-1-lb@semihalf.com> References: <20231223015131.2836090-1-lb@semihalf.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jim Cromie The function skip_spaces_and_coma removes leading spaces and coma. With this approach a user can provide dynamic debug control commands in new format. For example the following command (existing format) modprobe test_dynamic_debug dyndbg="class D2_CORE +p" can also be provided as (new format): modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p Signed-off-by: Jim Cromie Signed-off-by: Ɓukasz Bartosik --- lib/dynamic_debug.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 70d9440193a8..48ce24c39457 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -618,6 +618,14 @@ static int ddebug_change(const struct ddebug_query *query, return nfound; } +char *skip_spaces_and_coma(const char *str) +{ + str = skip_spaces(str); + if (*str == ',') + str = skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -631,8 +639,8 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) while (*buf) { char *end; - /* Skip leading whitespace */ - buf = skip_spaces(buf); + /* Skip leading whitespace and coma */ + buf = skip_spaces_and_coma(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf == '#') @@ -959,7 +967,7 @@ static int ddebug_exec_queries(char *query, const char *modname) if (split) *split++ = '\0'; - query = skip_spaces(query); + query = skip_spaces_and_coma(query); if (!query || !*query || *query == '#') continue; -- 2.43.0.472.g3155946c3a-goog