Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3418198rwa; Tue, 23 Aug 2022 04:34:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR43KQEPzhtWVJQxr06f1rxgbFLXY6pWct0O6M0YJQmAn5FZubDvoosGsMx/SsjR3EQJE/do X-Received: by 2002:a17:907:9691:b0:73d:8203:a119 with SMTP id hd17-20020a170907969100b0073d8203a119mr6518184ejc.704.1661254461890; Tue, 23 Aug 2022 04:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254461; cv=none; d=google.com; s=arc-20160816; b=Hf/98wQdxm/LjmxvZ6Gwkz9Y+lQY/N+BKt/Z/D8xpH9ZnQHoOBUeSjP35owTrZkvJw 2RgCd8dABKws8L8u97CAG1cQDbpsftxxj7rxZ17EbJYThAu2mcffeiGC7pfIYcUEqTsz lXeEiQ8+ZjpT7SUc3UxFw+4IMfgZ72DGpcDSOOdTi/CGgOXjIE/91esgJMBsjSP8cmG5 pHqjLCK6r8azc0lDIrbu/znG14H2tfPafcIkWwjD8xHSoj0+v9IXzmeV15FtShaMYx12 EJO93R+thKICzmsyJpPRFf3obOTLGcAz7usmPvZ012QB6P7wWmADTOOQW7QWv5lZ7CSF aXkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Niv2488Fj2qrHtJ5vX94VqoBsYQj+CUp2AlDg/VykHM=; b=qjBR98yUagO1b76p3h9robcNoTV0RCcYxXVOACndnZ4nLwxWO4xzUmCYVrbc5QzOI0 Rw2zm71FDbsJhD2OBRnGLv5qsVmw7srCkeY91RK9XJ0uN6c6HfNWo5AqHw//xEi0bLmJ puRoPyEOYSwxyy+Ln64mJYNrIfNh/ukG9wu0lgc2lTONmox91cPgzhXQsbXmqQx2epSL xaLQ+uYsThl6jykHrVqJGBmaJ2TV7Fy/V6DtOXBBrAQMEscht7WNkWiaxzLbZNaj0hmU nnCaR4B7wIfiQ/dTasqnVC3S7MF42Z45lmIwIYiy1dqa1G9kmbuTUP3Eqwc7FJmKIHAL wSdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X8ZCCDZE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go43-20020a1709070dab00b0073d5ae171fdsi10640356ejc.549.2022.08.23.04.33.55; Tue, 23 Aug 2022 04:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X8ZCCDZE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244081AbiHWLE5 (ORCPT + 99 others); Tue, 23 Aug 2022 07:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357440AbiHWLCX (ORCPT ); Tue, 23 Aug 2022 07:02:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03B6DB14F2; Tue, 23 Aug 2022 02:14:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 58380B81C85; Tue, 23 Aug 2022 09:14:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C9F5C433C1; Tue, 23 Aug 2022 09:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246085; bh=4wSFBcJWjvWoO4ac098ZRzL0AmRBvAtFIXEj5Kx1D2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X8ZCCDZEp5vBsr37rEyLoD75QsrVW0Cg/u2nA4Q1UIUpZ5dZnXhP4nl/oBNxoi+Xd W+4LeE3AAG1OZxCZTPbrdFmQ4Q7dtufcekN/hNVmxOFwbeKQjT1GxVZ16vNU28+egi chylYkzMKILmuRC/UcsF9K4qdeOWRWsiKy4/hxOI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ingo Molnar , Andrew Morton , Tzvetomir Stoyanov , Tom Zanussi , "Masami Hiramatsu (Google)" , "Steven Rostedt (Google)" Subject: [PATCH 4.19 285/287] tracing/probes: Have kprobes and uprobes use $COMM too Date: Tue, 23 Aug 2022 10:27:34 +0200 Message-Id: <20220823080111.120770239@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steven Rostedt (Google) commit ab8384442ee512fc0fc72deeb036110843d0e7ff upstream. Both $comm and $COMM can be used to get current->comm in eprobes and the filtering and histogram logic. Make kprobes and uprobes consistent in this regard and allow both $comm and $COMM as well. Currently kprobes and uprobes only handle $comm, which is inconsistent with the other utilities, and can be confusing to users. Link: https://lkml.kernel.org/r/20220820134401.317014913@goodmis.org Link: https://lore.kernel.org/all/20220820220442.776e1ddaf8836e82edb34d01@kernel.org/ Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Tzvetomir Stoyanov Cc: Tom Zanussi Fixes: 533059281ee5 ("tracing: probeevent: Introduce new argument fetching code") Suggested-by: Masami Hiramatsu (Google) Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_probe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/trace/trace_probe.c +++ b/kernel/trace/trace_probe.c @@ -361,7 +361,7 @@ static int parse_probe_vars(char *arg, c } } else ret = -EINVAL; - } else if (strcmp(arg, "comm") == 0) { + } else if (strcmp(arg, "comm") == 0 || strcmp(arg, "COMM") == 0) { if (strcmp(t->name, "string") != 0 && strcmp(t->name, "string_size") != 0) return -EINVAL; @@ -544,7 +544,7 @@ int traceprobe_parse_probe_arg(char *arg * The default type of $comm should be "string", and it can't be * dereferenced. */ - if (!t && strcmp(arg, "$comm") == 0) + if (!t && (strcmp(arg, "$comm") == 0 || strcmp(arg, "$COMM") == 0)) t = "string"; parg->type = find_fetch_type(t, ftbl); if (!parg->type) {