Message ID | 20230419214140.4158-2-beaub@linux.microsoft.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp682573vqo; Wed, 19 Apr 2023 14:46:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YkBVPzk+eYKqbdEW/qs6+4TiUICbGmL6OFfWyxjvH5+r6KJqE955D0N3jzt+pzb8KtzB+H X-Received: by 2002:a05:6a21:3282:b0:ec:74b:d247 with SMTP id yt2-20020a056a21328200b000ec074bd247mr5949309pzb.44.1681940762991; Wed, 19 Apr 2023 14:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681940762; cv=none; d=google.com; s=arc-20160816; b=oUxP/8fSPnCxvCqKFl1uwUgg/tbr9gcS5KadE+jvl+YIm99gjQ7tFC2ra+jyYIhpLK wROcvnf6xVgnfR6zuONU1j+GSF7JXh3oH2+Td26B/BN63hlxIP8xSJgPdWo+eTyMcp2E u/xYR5eA96tKjEIDV1qr4OcFILfwui7JnE3+8moYgEjIcHEc8NpOTeWsp4KYzvEABZVI m51e02iNPo2jExQmiCZnQyfx+6eslIYfL8bEGIs6qBsJ37V3zclaPPVLqeL5X580RCeU p3V6Eox1IHZfQquL+US53QiwOlbvpq6+WiDsIyphGrLFtnVgMlNPoX7jZ9fnVG7BUSN4 FW8A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=At02062WqVBPFH5DXB8GaOuC2yKzAnMYYo2tjBSjyqg=; b=P8KlBbTWwuZCl15TwO7SpeCmdGkQpn5KG1FmG+QspuxmVYO4KuFlSWKwywKJnmAVaQ Lnt4l4mTL20VlkArouuNYwyxzocDrOK+MOnwZ+GKU3W/qzU2Xn0cN0AafJ8fwVMCc6Dg lWepHk/1Ah9qNR9msW2rFygqdo6ml2pQf167JDbuvK9Fl8odf6HO+WdRnKBqIxbJy0c0 ESHvKRtHIyXggxlntogi8CKmrlv6yUoyx9rVNDfS4c5AL2Lj3y4TzSF9Osfk6HNhOpud XO+Q76TsUSsPElkoFLUTsGFcx1NP3oIFuakFaKvInUmng17KoTJpKoQUaJD/c6pq8zXw qlDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=HWAjdMn1; 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=linux.microsoft.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020a634a0f000000b0051f0e959dc6si5618676pga.483.2023.04.19.14.45.50; Wed, 19 Apr 2023 14:46:02 -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=@linux.microsoft.com header.s=default header.b=HWAjdMn1; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbjDSVly (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Wed, 19 Apr 2023 17:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbjDSVlu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Apr 2023 17:41:50 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 160861BEB; Wed, 19 Apr 2023 14:41:49 -0700 (PDT) Received: from W11-BEAU-MD.localdomain (unknown [76.135.27.212]) by linux.microsoft.com (Postfix) with ESMTPSA id 7842121C2057; Wed, 19 Apr 2023 14:41:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7842121C2057 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1681940508; bh=At02062WqVBPFH5DXB8GaOuC2yKzAnMYYo2tjBSjyqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HWAjdMn1ofGLAeYetRgxVoZ9998/Ls/oJmCP29Izqe6vHpioyRdlXvqs4gZ4/bXMW fTP5Dh3jnlPMuu3iu+JNFBq5m0InOehhnZGlLFIzT6vYh/VIJJWpJwZ8HzbtGLQ493 OwH3+hiXH3R78qCIKElgMDPVzotF6mc8riib9w0A= From: Beau Belgrave <beaub@linux.microsoft.com> To: rostedt@goodmis.org, mhiramat@kernel.org, dcook@linux.microsoft.com, alanau@linux.microsoft.com Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH 1/2] tracing/user_events: Set event filter_type from type Date: Wed, 19 Apr 2023 14:41:39 -0700 Message-Id: <20230419214140.4158-2-beaub@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230419214140.4158-1-beaub@linux.microsoft.com> References: <20230419214140.4158-1-beaub@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763642717563384017?= X-GMAIL-MSGID: =?utf-8?q?1763642717563384017?= |
Series |
tracing: Fix print_fields() and use best filter
|
|
Commit Message
Beau Belgrave
April 19, 2023, 9:41 p.m. UTC
Users expect that events can be filtered by the kernel. User events
currently sets all event fields as FILTER_OTHER which limits to binary
filters only. When strings are being used, functionality is reduced.
Use filter_assign_type() to find the most appropriate filter
type for each field in user events to ensure full kernel capabilities.
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
---
kernel/trace/trace_events_user.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index cc8c6d8b69b5..eadb58a3efba 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -918,6 +918,9 @@ static int user_event_add_field(struct user_event *user, const char *type, field->is_signed = is_signed; field->filter_type = filter_type; + if (filter_type == FILTER_OTHER) + field->filter_type = filter_assign_type(type); + list_add(&field->link, &user->fields); /*