Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2928199pxb; Mon, 4 Apr 2022 03:12:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2NCYC2zcSAfrgisQI6fkfmk/9dcCDe09sCKdTMOhvH+svwkpsshwujTYpylqNVEMSVMOU X-Received: by 2002:a17:902:ea03:b0:154:4af3:bb5e with SMTP id s3-20020a170902ea0300b001544af3bb5emr22802591plg.95.1649067153614; Mon, 04 Apr 2022 03:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649067153; cv=none; d=google.com; s=arc-20160816; b=HsiDjIZfR34uTWq/J2BXEQhAqce3lWbjnsl9Akj8+Aipg5z+jKPBlxJlXfaMc/DCxD a4H/hFescPUGQ6gTmSs3iHToxKBaG1829E/zsCFE7Vbj13IW3Eqxii02r82cV9M/ooPN jbUCSUvpQBenxeuND0VzW0D2ga3c2rtmbUPyE7cMkIl54HrSUhTuVlE3Zn1WW94r0FW9 VOP+tZCjc4My0NHPCUKsjw1mDCwqQnGv6flG2ghtj3QdaSKUZw0yYVwCCFgzzm4Zxc7i 5/h4lNMOFKgI0Io1uz+AYnNTEwdIRgJH6uRybgk+Ti+MfjC+e2UyjNhIHThM1N5V4DXv GXlQ== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=o3+64FyHzHFGISd3O72rfJhaBDSRw3VyMvr43Q6rw9Q=; b=zNwfApl5MR041GzFRynLu+P+xG1TyMmdWFElAo/GBMfXpo1YDHYiH3KFHP8OpkeXHH R0aomgNW+E2rU0FlfY+gCF16zcer1fKgnsva6ehCayvjzEdfbvqTN/TPm3WTFqEmFG4K 4wKTdG1IYs5Od9Rq9Ezaab2wy16eEUVLZjhK15u0TTviaBQsEWx3z0UzEQ6/ofV8Ydq9 lCmnHvD1whNjZeg35HI5Td3dDHAPi/Y6bajLbjGb569LDc0Kv0eM6so2RhDyEvL8PxYy LhqWPXJau1SOz7vzkKfphngTDlNp8htmO2mblGw9GaeXioNmObF5oK5rOGcY8BuWQTox DoNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=nwnS8u68; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 188-20020a6308c5000000b003816043ef0dsi9748168pgi.258.2022.04.04.03.12.20; Mon, 04 Apr 2022 03:12:33 -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=nwnS8u68; 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 S1353463AbiDAXpT (ORCPT + 99 others); Fri, 1 Apr 2022 19:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236763AbiDAXpQ (ORCPT ); Fri, 1 Apr 2022 19:45:16 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E619F10A1; Fri, 1 Apr 2022 16:43:23 -0700 (PDT) Received: from localhost.localdomain (c-73-140-2-214.hsd1.wa.comcast.net [73.140.2.214]) by linux.microsoft.com (Postfix) with ESMTPSA id 5F65B20DEEDA; Fri, 1 Apr 2022 16:43:23 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5F65B20DEEDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1648856603; bh=o3+64FyHzHFGISd3O72rfJhaBDSRw3VyMvr43Q6rw9Q=; h=From:To:Cc:Subject:Date:From; b=nwnS8u68KgDr+OZ9f4Qu/8BJK7Bn+8NjRTt8KNu/fach/C3ELFciafdvpGwav30wl MjwbhzpCwTcUofazZGwUKvB8gz9XMlNjLQ3bPcs9EH5M4c3AfEZBB3kAhcmaofpdGr BfU74a3W45oDaeY4FN6Gt8Wn5wjtEjlF+aaxQsPg= From: Beau Belgrave To: rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com Cc: linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, beaub@linux.microsoft.com Subject: [PATCH 0/7] tracing/user_events: Update user_events ABI from Date: Fri, 1 Apr 2022 16:43:02 -0700 Message-Id: <20220401234309.21252-1-beaub@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 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: X-Mailing-List: linux-kernel@vger.kernel.org This series covers the changes that were brought up once user_events went into 5.18. The largest change is moving away from byte index to a bit index, as first suggested by Mathieu Desnoyers. The other changes are either fixes that have accumulated or found by Mathieu. NOTE: The sample and self-tests do not build unless you manually install user_events.h into usr/include/linux. Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Psuedo code example of typical usage with the new ABI: struct user_reg reg; int page_fd = open("user_events_status", O_RDWR); char *page_data = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, page_fd, 0); close(page_fd); int data_fd = open("user_events_data", O_RDWR); reg.size = sizeof(reg); reg.name_args = (__u64)"test"; ioctl(data_fd, DIAG_IOCSREG, ®); int status_id = reg.status_index; int status_mask = reg.status_mask; int write_id = reg.write_index; struct iovec io[2]; io[0].iov_base = &write_id; io[0].iov_len = sizeof(write_id); io[1].iov_base = payload; io[1].iov_len = sizeof(payload); if (page_data[status_id] & status_mask) writev(data_fd, io, 2); Beau Belgrave (7): tracing/user_events: Fix repeated word in comments tracing/user_events: Use NULL for strstr checks tracing/user_events: Use WRITE instead of READ for io vector import tracing/user_events: Ensure user provided strings are safely formatted tracing/user_events: Use refcount instead of atomic for ref tracking tracing/user_events: Use bits vs bytes for enabled status page data tracing/user_events: Update ABI documentation to align to bits vs bytes Documentation/trace/user_events.rst | 46 ++-- include/linux/user_events.h | 19 +- kernel/trace/trace_events_user.c | 213 ++++++++++++------ samples/user_events/example.c | 12 +- .../selftests/user_events/ftrace_test.c | 16 +- .../testing/selftests/user_events/perf_test.c | 6 +- 6 files changed, 187 insertions(+), 125 deletions(-) base-commit: bfdf01279299f1254561d6c2072f1919e457e23a -- 2.25.1