From patchwork Tue Jan 31 02:33:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 50572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2516881wrn; Mon, 30 Jan 2023 18:35:48 -0800 (PST) X-Google-Smtp-Source: AK7set/uq6o9Uk9Hzah0n6TO4XRxBuvw3tSsCAmOVnkSvigTKcbeqAF14ITcewmPKoDg3A6BpvSK X-Received: by 2002:a17:906:3789:b0:87d:eff1:acc8 with SMTP id n9-20020a170906378900b0087deff1acc8mr14166887ejc.48.1675132547971; Mon, 30 Jan 2023 18:35:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675132547; cv=none; d=google.com; s=arc-20160816; b=BliqQKx7DXoIWJuligmsFQEI9En9L0LpCJBoCulB0vVXwPK1DmKgnwhS4SP3dgDLA1 eAssSvhVVoOU4ETDPg9WiMg3ARvHg/LLwJzt/n+R9Ky3Qg3jWW6jar4gFbMJWFJRdifV oBgp5eNHTzJX/5DDPJpoWuXrNQC0DdPjgBACGdvyBhyXLu7zCZraE9pMAA8WUWYqP3el rhnS9gMQBiOtzPrhM0B0tD+IDFQAOMCOcd+Xk5YthFZjPgnvJxxHv0YBrdEH62fjpG3W ocAbD6MpmQqQDKJCqyKjUSP2nAhQUym8GXWLl1hXNHy4WVcYDwsU+Mu6+DpDD7Sl2RmI Hu5g== 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:sender :dkim-signature; bh=UYmg7u8BuMXGs5kfhUOaWTWsCts8KrLu3C1CWq/3WHM=; b=FjTCxNQiuB7v6UDTj94KgEwEHg7ou9tRRo37w6G1E6AMk8rKnvmR5uGwLsqdDQV57E d8icxPlDgZAHTQxK99XGXEWSXy8rCj8PD2MZAviBarqu0fD0MJYgPOUI6YHY/iiaElrm dEYIYkEmTaTQb5e2KT9lws8QPROSbNVNmcjSCDK7+L+DDFCVbFYhP7wckJ5ylzt6lKEI DDLTR1Va67IilEsk79o1ys8OSA1AngsY1neCnVwTpldj+G1SA6lw0WPdiFsaoMAzdPPf kRGPGJNnorujk8L9c96OgQPAwGov4Ikgt/xsfH/91vrmbMjKK1NkUxB3OZxH4dpS1pQ9 4Czg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RTGJbkgf; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a170906018d00b0087f1daeb101si11697147ejb.312.2023.01.30.18.35.24; Mon, 30 Jan 2023 18:35:47 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=RTGJbkgf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbjAaCeB (ORCPT + 99 others); Mon, 30 Jan 2023 21:34:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjAaCd4 (ORCPT ); Mon, 30 Jan 2023 21:33:56 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9DC6233E6; Mon, 30 Jan 2023 18:33:54 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id z1-20020a17090a66c100b00226f05b9595so13073141pjl.0; Mon, 30 Jan 2023 18:33:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=UYmg7u8BuMXGs5kfhUOaWTWsCts8KrLu3C1CWq/3WHM=; b=RTGJbkgf23Vqp0k6oNVwNP/dnObdTu5cDug2Sy9PX/05iTauQBtYdWbumFoFberAEJ Dva/GD2vHJSRgljKfENSIfM8h0Ht4NDON0CbdHpojXxjASUdBbH8G1JGVovp0BSRYmPW Yr+BvfOk6WX3zHhFlUx9pkeOOFBkxXKQ9nOApt0hL05Gzmt/CqWiiHxjteRVQiwaxr2U WVwoXYqQ7T7sSE48/nnBgEbR4pyV7v9ff8ms15oT1XiwLrot3c08/jkj4+tLVVKEq+gx Mg92A4LsBW3tNhq+9a3vyV9le0NI8aYz9ysgY+ih8B4c3QUJejnIweno94hxpruKYWge v0wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=UYmg7u8BuMXGs5kfhUOaWTWsCts8KrLu3C1CWq/3WHM=; b=JHABnFZ6DsiSfDmqPP6AU+ztYdG2QzoOiDGIoX4K91eiSpe10QaSdf0cNWdIhrYnRX sqqzeZllDo8MNj4e8gObHZNEgpQAhZT3gmCmyGCxHRaAnEih6HWY48xplcVuLDRCEXHU HBUDvlKQrfeIgGgxHCUK3v+iYsW8PgP06+Q74ijhxH9+zUHtUwtsqY9xvQwQGGRjXMwB ebU+hb7qQNdjifWUcBy3zflsTuJt8llSExJ7vXuOwtKaqzDovDOcfxx7I4d1Q8PoORS2 j038aLYYbG28sUXjOt93gnDQ7Mxv8IYQ7NxVauI5lwXRb5UkYgxk6fcBDPeKrluL1cJ1 MO4g== X-Gm-Message-State: AO0yUKVHq26QGaHmAfW9T3tqqpR9gT1j/cmmv+LOhUdbcJx2JYD/acYT ogriZxqF7tq9URZdDK6MTd4= X-Received: by 2002:a17:90a:1952:b0:22c:3edd:7e48 with SMTP id 18-20020a17090a195200b0022c3edd7e48mr16423999pjh.32.1675132434199; Mon, 30 Jan 2023 18:33:54 -0800 (PST) Received: from balhae.hsd1.ca.comcast.net ([2601:647:6780:ff0:3f41:4035:c56c:92cc]) by smtp.gmail.com with ESMTPSA id u13-20020a17090a6a8d00b00228f45d589fsm7640582pjj.29.2023.01.30.18.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 18:33:53 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users@vger.kernel.org, James Clark , Leo Yan , Stephane Eranian Subject: [PATCH 1/4] perf inject: Use perf_data__read() for auxtrace Date: Mon, 30 Jan 2023 18:33:47 -0800 Message-Id: <20230131023350.1903992-2-namhyung@kernel.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230131023350.1903992-1-namhyung@kernel.org> References: <20230131023350.1903992-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756503786700566443?= X-GMAIL-MSGID: =?utf-8?q?1756503786700566443?= In copy_bytes(), it reads the data from the (input) fd and writes it to the output file. But it does with the read(2) unconditionally which caused a problem of mixing buffered vs unbuffered I/O together. You can see the problem when using pipes. $ perf record -e intel_pt// -o- true | perf inject -b > /dev/null [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] 0x45c0 [0x30]: failed to process type: 71 It should use perf_data__read() to honor the 'use_stdio' setting. Fixes: 601366678c93 ("perf data: Allow to use stdio functions for pipe mode") Reviewed-by: James Clark Signed-off-by: Namhyung Kim --- tools/perf/builtin-inject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index 3f4e4dd5abf3..f8182417b734 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -215,14 +215,14 @@ static int perf_event__repipe_event_update(struct perf_tool *tool, #ifdef HAVE_AUXTRACE_SUPPORT -static int copy_bytes(struct perf_inject *inject, int fd, off_t size) +static int copy_bytes(struct perf_inject *inject, struct perf_data *data, off_t size) { char buf[4096]; ssize_t ssz; int ret; while (size > 0) { - ssz = read(fd, buf, min(size, (off_t)sizeof(buf))); + ssz = perf_data__read(data, buf, min(size, (off_t)sizeof(buf))); if (ssz < 0) return -errno; ret = output_bytes(inject, buf, ssz); @@ -260,7 +260,7 @@ static s64 perf_event__repipe_auxtrace(struct perf_session *session, ret = output_bytes(inject, event, event->header.size); if (ret < 0) return ret; - ret = copy_bytes(inject, perf_data__fd(session->data), + ret = copy_bytes(inject, session->data, event->auxtrace.size); } else { ret = output_bytes(inject, event, From patchwork Tue Jan 31 02:33:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 50573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2516887wrn; Mon, 30 Jan 2023 18:35:49 -0800 (PST) X-Google-Smtp-Source: AK7set8XCpv+kNz7RbX/fT1B0Ju1bvQzwUUPatnEa45R4uujGpRpXO2gxgQTsoE335ED7PjlRhl1 X-Received: by 2002:a17:906:aca:b0:883:fe6b:814 with SMTP id z10-20020a1709060aca00b00883fe6b0814mr10847791ejf.37.1675132549568; Mon, 30 Jan 2023 18:35:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675132549; cv=none; d=google.com; s=arc-20160816; b=kiOtB4IfRxD6D5J2NUbPrMVvPPU5KrlXSfm37kytNBM29RtMzZpOLlkzc9YEvJ7a6y 6i+tK+z5D/kVnEagbf5Tg4HZ/nIY8r3VCkbPMODu7k7eNpYRYkPZhvHYqcryFjqTuaM4 7iehGrT9xiWEm2eudWDQEObPd/1L4i1sdaWm8UqNtcx/KZxTsVZvJDVzCPSDmCthkLos v9l+PG6Iv9wprvwhC0RJm8kwx5aKAFGEZc3ImoE9/C0AcWuVSvkHV4+I2g2zqYA77sn8 TCiUbZFYQgps7naWL66/WVCruNUMDx9asu8EE2mwH8LqXceyjAB5FKzBaYea1SWa0Bsm 2obQ== 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:sender :dkim-signature; bh=8hEMIzHdLpwwG0PzQtXZ+smccu5A316Bg7CzC9BcgGQ=; b=mBSZ9uOaaox5u3ktrNbYms2aK4Oz3ZKmfTvlm4ki8YEK+drI2Itu3AQ+m77N0/V7rS C5QCEEsli0rGfL7S459bpPCSe/FvRPp+gvPh1mCouJQzgeV89oBEzMa9Ivm3h7v3ykab hDR5aULxQrVdRMR/rvUQ96H25HPQZ8ik9tW3wV6itLgBqdiDfjfxdt1/f6b114uKGrlr klcC/rBut4auSKlrRayO12BccZ3CfRAZY8aauK6qR4j/fRy6k7kUNF3yXtM8e6Bw3Qw3 qg1QLp1R1JhPZJwJFb45PMqw07UoV/2WKDVJ4qp8V+CTFG2G14pdUo02jTwikx2IPgi6 sBkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aX3IGXAL; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a17090674c400b00888161349d1si5625036ejl.663.2023.01.30.18.35.25; Mon, 30 Jan 2023 18:35:49 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=aX3IGXAL; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbjAaCeG (ORCPT + 99 others); Mon, 30 Jan 2023 21:34:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229883AbjAaCd6 (ORCPT ); Mon, 30 Jan 2023 21:33:58 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C49D221958; Mon, 30 Jan 2023 18:33:56 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id h9so5058226plf.9; Mon, 30 Jan 2023 18:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=8hEMIzHdLpwwG0PzQtXZ+smccu5A316Bg7CzC9BcgGQ=; b=aX3IGXALKXnDwSdfOKndnNKd9jKWl88rlYjbvDS85tueylN1U7/B/iuhXgYlhsfJoU 5FsIm+zwGWYfd3RVy2E4ZzulzTPASIH0kYA7nsR1sLQzQWH4DkIAU/HuvOvOxKc/65Uk Kwno1gxhzTuaiOm696JJP87e8F61yEcAx8KX8aNAcXz1EwJv9T/5XVH2yyft88R6/m9l CC747rLGdhaTvbkP9kVRdmsG3wOJQJN9QCkpB7BwdruoldIoWVB73hcFVzr08ebAPHkK OivOJ91pI8B6hKZdRTnQNIA75EV/eWYPJhEVXVK2bFKse3Hf4jY4416sKmFzKb65BLtr /JKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8hEMIzHdLpwwG0PzQtXZ+smccu5A316Bg7CzC9BcgGQ=; b=mkQNAtCUpruVEtQp0j8iEkrGVXYRQV5ExKEaU5yiJiQYsSGO2amA/a310cJl8z7Xgt XfzhGy4IC2+WTOnw4Z2ABBwdQeKcqcEWsTKeMqPc8qqHv/GKQFTmMtCDRatj5aMKHSYu SIkC8YU+XkVCn6rMpvFVkSfiB4pCtumSeeGK0ZNC4kGjGebSzopOgHWczSCggDr+cZpJ SHe7IAXEkkLMUh/RDNHP1gtH8vjMAUSUMSO2fsRN8G38k2amPWRcSwb7s8C4ug9SEY6h R0hqWmJyhEt4JInvxq2RzcDkHavUwqMCfcscIODmd3kpIQD3HErDntT3uCufrgvEP6Fm +9Vw== X-Gm-Message-State: AFqh2kqemb3krNPtKeCCHZEcmXsErRBsxnhSKIdmP/9e0bKClYQnsD27 BKk2VEkmhp5IUCZaA3S7DdA= X-Received: by 2002:a17:90a:4302:b0:219:9da5:40d3 with SMTP id q2-20020a17090a430200b002199da540d3mr55472724pjg.1.1675132435829; Mon, 30 Jan 2023 18:33:55 -0800 (PST) Received: from balhae.hsd1.ca.comcast.net ([2601:647:6780:ff0:3f41:4035:c56c:92cc]) by smtp.gmail.com with ESMTPSA id u13-20020a17090a6a8d00b00228f45d589fsm7640582pjj.29.2023.01.30.18.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 18:33:55 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users@vger.kernel.org, James Clark , Leo Yan , Stephane Eranian Subject: [PATCH 2/4] perf intel-pt: Do not try to queue auxtrace data on pipe Date: Mon, 30 Jan 2023 18:33:48 -0800 Message-Id: <20230131023350.1903992-3-namhyung@kernel.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230131023350.1903992-1-namhyung@kernel.org> References: <20230131023350.1903992-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756503788253115246?= X-GMAIL-MSGID: =?utf-8?q?1756503788253115246?= When it processes AUXTRACE_INFO, it calls to auxtrace_queue_data() to collect AUXTRACE data first. That won't work with pipe since it needs lseek() to read the scattered aux data. $ perf record -o- -e intel_pt// true | perf report -i- --itrace=i100 # To display the perf.data header info, please use --header/--header-only options. # 0x4118 [0xa0]: failed to process type: 70 Error: failed to process sample For the pipe mode, it can handle the aux data as it gets. But there's no guarantee it can get the aux data in time. So the following warning will be shown at the beginning: WARNING: Intel PT with pipe mode is not recommended. The output cannot relied upon. In particular, time stamps and the order of events may be incorrect. Fixes: dbd134322e74 ("perf intel-pt: Add support for decoding AUX area samples") Reviewed-by: James Clark Signed-off-by: Namhyung Kim Reviewed-by: Adrian Hunter --- tools/perf/Documentation/perf-intel-pt.txt | 30 ++++++++++++++++++++++ tools/perf/util/auxtrace.c | 3 +++ tools/perf/util/intel-pt.c | 6 +++++ 3 files changed, 39 insertions(+) diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index 7b6ccd2fa3bf..9d485a9cdb19 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -1821,6 +1821,36 @@ a trace that encodes the payload data into TNT packets. Here is an example $ +Pipe mode +--------- +Pipe mode is a problem for Intel PT and possibly other auxtrace users. +It's not recommended to use a pipe as data output with Intel PT because +of the following reason. + +Essentially the auxtrace buffers do not behave like the regular perf +event buffers. That is because the head and tail are updated by +software, but in the auxtrace case the data is written by hardware. +So the head and tail do not get updated as data is written. + +In the Intel PT case, the head and tail are updated only when the trace +is disabled by software, for example: + - full-trace, system wide : when buffer passes watermark + - full-trace, not system-wide : when buffer passes watermark or + context switches + - snapshot mode : as above but also when a snapshot is made + - sample mode : as above but also when a sample is made + +That means finished-round ordering doesn't work. An auxtrace buffer +can turn up that has data that extends back in time, possibly to the +very beginning of tracing. + +For a perf.data file, that problem is solved by going through the trace +and queuing up the auxtrace buffers in advance. + +For pipe mode, the order of events and timestamps can presumably +be messed up. + + EXAMPLE ------- diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index c2e323cd7d49..d4b04fa07a11 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -1133,6 +1133,9 @@ int auxtrace_queue_data(struct perf_session *session, bool samples, bool events) if (auxtrace__dont_decode(session)) return 0; + if (perf_data__is_pipe(session->data)) + return 0; + if (!session->auxtrace || !session->auxtrace->queue_data) return -EINVAL; diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 6d3921627e33..b8b29756fbf1 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -4379,6 +4379,12 @@ int intel_pt_process_auxtrace_info(union perf_event *event, intel_pt_setup_pebs_events(pt); + if (perf_data__is_pipe(session->data)) { + pr_warning("WARNING: Intel PT with pipe mode is not recommended.\n" + " The output cannot relied upon. In particular,\n" + " timestamps and the order of events may be incorrect.\n"); + } + if (pt->sampling_mode || list_empty(&session->auxtrace_index)) err = auxtrace_queue_data(session, true, true); else From patchwork Tue Jan 31 02:33:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 50575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2516967wrn; Mon, 30 Jan 2023 18:36:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXur+oH3lWwV4pm4tfpvolS9Pg/MmHgW3fqAOYPu0DPC97fwmEsfvOmomQtuTFIZfl/qMvkV X-Received: by 2002:a17:907:3e18:b0:84d:3403:f4f2 with SMTP id hp24-20020a1709073e1800b0084d3403f4f2mr69076463ejc.62.1675132561743; Mon, 30 Jan 2023 18:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675132561; cv=none; d=google.com; s=arc-20160816; b=FywhvFyBaDmWA/PCno4yKZXR/PhYjaYrJ/vMarXbZgfTnkuxIDh+vCDE3H6Nam7wkd FhxmtAJwWu/+YDkQOwZWJ7CZ86AYurSmexMC+TNk0o45jUVdNlnufzYBfbZkvVQNLB7Q 0cJPHHLEXKyhE5tvuNqZ4WUiEM+MCk4IQ8ZLDApQ2F+ftgqb65I5zLQm3VcHV0alPE0M iSUeBRn9gkKeLTC/B+FrhjmsDkmuDXmK33cIray4VcNERuwJlZjOcuw80lyt7+1rNnEV XV7r5WBpKHUQxcH2TFF5eaasWd4zpRxehyH9Wb1uB0UPSZAw2NlUqBMtauah2VXWJxBT /Esg== 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:sender :dkim-signature; bh=yCu/OJvZgrHmpfb4wOiCy+fL/exx0kcJ6xVqf60vg6E=; b=BBlEWPxBazIDHgXSj18kSRw3AzyjlTbU8Let85dr5IPe7YvnwV4HZqf18vixD7hU+q Aud8ue6P2lfL04JqmMwrluppJNrp2UvPp6x2vCFE3SWZqr+r4pLGHDqSaxIEoqcw9dpV QtyRkYjfoErsZskDAguEJjfEjzLvtOQtAaXyaASZ8MoMvBgwIPrOU5iTNVGwppCUgE1Z MDC/W0FX7gWJFESfVhNPwxcSNihZPB0UXXNf6+xi0v1jatd4u3qWA+roDnyJhbnrocV/ ezp8R2mRGnNTnA6vOSPfaKr09wEL0vOKgW2t650ANk/LhKsqXl/T4030xIvqDSMmjn0I +B9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EgbWRsq6; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020a17090791d600b00878529e9d49si8548078ejz.573.2023.01.30.18.35.38; Mon, 30 Jan 2023 18:36:01 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=EgbWRsq6; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230138AbjAaCeN (ORCPT + 99 others); Mon, 30 Jan 2023 21:34:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjAaCeF (ORCPT ); Mon, 30 Jan 2023 21:34:05 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 933243346C; Mon, 30 Jan 2023 18:33:58 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d3so13625801plr.10; Mon, 30 Jan 2023 18:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=yCu/OJvZgrHmpfb4wOiCy+fL/exx0kcJ6xVqf60vg6E=; b=EgbWRsq6rbwJbO0WuPuCoYZ6aLWhZ5pnB//zXVtrgvkkPl5AU4kylWRecsWuSayikh sF7B8CjKhpu3E6Fg3kMqGQH+4b99eBmtl02mvKwRxOd9dEOEnY+4RZ3qwVbQf/pNJIzq S38ioAC+VkrzSvXCWh7C6hwDlVe6yC2N5INJ+oJn94dx4seBVmafKJPRSaQ68tM9dWIC C/vi5ctj8pM7Z0drawFJ2Spz07IMbTpePPZc9QKq/lyn9a708OcAmbzsp+YSqPY+qrQz 7VFWkpaWCsYwargAbQJPBbx/ZsSgDFrm/byUV/VUysoh4Yn8fy7Aw3EKkuYRDXseq9T5 FbJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yCu/OJvZgrHmpfb4wOiCy+fL/exx0kcJ6xVqf60vg6E=; b=zXJ5ElRb5S5c0EpKzh5U6YOFmsfF9vpVsLAFKmYiLFJafgXs2b0DEv20jJSwOSJb+/ 4gVstBAd+gTFJ0kRer7laUf2GDzHwgoebm0ivieZrwVFcvtXX20eIPgi323ecOBzZ0d2 rMLVkoO6OBhdTlfhy50xmBR48RPVB2OHofqg37wkm6dsl874quqOu79otLNUK8ZGj/Wu 4JhpOS3WrQapTx639FUg+SGHXb8ZKEK67jw/gXk1ac42KUXzkywMwf6v5qwcBUkNuZcZ YbtkiLLPhWEQxRcfQYkD/fv4QgukN/Kum9g8GD6GgCQSt7nKqmgQGEHmCvpcTu6eAReb Vy4A== X-Gm-Message-State: AFqh2kqW/YcSB20P64YxbLeBnvAlbm6bAkT823U5COnDUC1RlGxQI+Qc fnulQi3XwHM7Im1I/fh1ruk= X-Received: by 2002:a17:90b:1e0f:b0:22b:bcb7:610c with SMTP id pg15-20020a17090b1e0f00b0022bbcb7610cmr39986773pjb.44.1675132437475; Mon, 30 Jan 2023 18:33:57 -0800 (PST) Received: from balhae.hsd1.ca.comcast.net ([2601:647:6780:ff0:3f41:4035:c56c:92cc]) by smtp.gmail.com with ESMTPSA id u13-20020a17090a6a8d00b00228f45d589fsm7640582pjj.29.2023.01.30.18.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 18:33:56 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users@vger.kernel.org, James Clark , Leo Yan , Stephane Eranian Subject: [PATCH 3/4] perf session: Avoid calling lseek(2) for pipe Date: Mon, 30 Jan 2023 18:33:49 -0800 Message-Id: <20230131023350.1903992-4-namhyung@kernel.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230131023350.1903992-1-namhyung@kernel.org> References: <20230131023350.1903992-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756503800754567823?= X-GMAIL-MSGID: =?utf-8?q?1756503800754567823?= We should not call lseek(2) for pipes as it won't work. And we already in the proper place to read the data for AUXTRACE. Add the comment like in the PERF_RECORD_HEADER_TRACING_DATA. Reviewed-by: James Clark Signed-off-by: Namhyung Kim --- tools/perf/util/session.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 7c021c6cedb9..fdfe772f2699 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1699,8 +1699,13 @@ static s64 perf_session__process_user_event(struct perf_session *session, case PERF_RECORD_AUXTRACE_INFO: return tool->auxtrace_info(session, event); case PERF_RECORD_AUXTRACE: - /* setup for reading amidst mmap */ - lseek(fd, file_offset + event->header.size, SEEK_SET); + /* + * Setup for reading amidst mmap, but only when we + * are in 'file' mode. The 'pipe' fd is in proper + * place already. + */ + if (!perf_data__is_pipe(session->data)) + lseek(fd, file_offset + event->header.size, SEEK_SET); return tool->auxtrace(session, event); case PERF_RECORD_AUXTRACE_ERROR: perf_session__auxtrace_error_inc(session, event); From patchwork Tue Jan 31 02:33:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 50574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2516927wrn; Mon, 30 Jan 2023 18:35:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXv2bZ9ifiAHqaly9EC6FR0FHI02sSU4frtC8Ziz9C8VTZiBIqmiMlvBT8knW5iOECQY7jvV X-Received: by 2002:a17:906:7748:b0:7c0:e30a:d3e5 with SMTP id o8-20020a170906774800b007c0e30ad3e5mr49128331ejn.18.1675132554754; Mon, 30 Jan 2023 18:35:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675132554; cv=none; d=google.com; s=arc-20160816; b=P+m1mRFCNojx2lzYI1oZkmJ2i+mvVqvq/1aa7L6NQ7rV8udrRbfQz9A/Tc5ZJAlKvK a42dQCcD2CFIx5u4Hyp1IJ7Z+Fqdq9YfoMLDizXEK8jH+bXRIOEEqH18iE+XLJNNChh+ Q8GoSDnv86ibWSlGUGyYIRBPgoj3Bcf2Ld3K0sRXmqBzS0QsZUoAm8mdDXJiOqJm4F2C HI5qgIejcGwTrGsn1u2h7Sey1GH/qYvm+KCaZEUtaW5WnLfveV+iyxBI1pcIm17ZdLyP o/+Z4Wyl9WeLxpU9G0CdrAxlbdFGGSqqJ6ZeoJDtyS4nu/bK+Rk9lxjjk4IbggRX61p3 i4yg== 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:sender :dkim-signature; bh=HRrV7TjTlPA/BkPaOPUYQ8wwbHiOpKT0qv7GK3Tslrg=; b=nLI17Y0j5LnMascJCxrN53i5PVUzb2V/qnnBlG6v5dWv6tDUA7i0AYjKA0Ch4VV/UI 04mzMdcR28Pj2nCSAwu7OwbsJLwTiaclqtl5YLSYCM926mEmCm/y+wwSdcRNyeuVsUCG tphwf/wIMqktqUrOYoYYxcOFVK8EphNvy88U8W3rrjq6sx5TzY8kUotOHD+tu9vVUoFL lkiGu07UD+mJpM9xcovJ2YhqSVa8QkSYFAlK4yd1oCNvQyQpoo2QbyZr+nVeAxL7LxJa TZUJeaoj5suj+8AQPlz9lagRJj8dMlDY8tid7+sCfia973bpcTuGQLKn1G7KsxqWuHGh XD2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fFDIWDUF; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a170906935000b0084d7c8a4bdfsi14250427ejw.276.2023.01.30.18.35.31; Mon, 30 Jan 2023 18:35:54 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=fFDIWDUF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230106AbjAaCeK (ORCPT + 99 others); Mon, 30 Jan 2023 21:34:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbjAaCeE (ORCPT ); Mon, 30 Jan 2023 21:34:04 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D725336084; Mon, 30 Jan 2023 18:33:59 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id b5so6408715plz.5; Mon, 30 Jan 2023 18:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=HRrV7TjTlPA/BkPaOPUYQ8wwbHiOpKT0qv7GK3Tslrg=; b=fFDIWDUFi/gMbk90i7BKU0biXYThbFrvns3JS/E/592VMsOumS8JfuTb8g+/ucdJvt DBbjZGK029lXRrU5R4C5odHdMjMagiLVyNsiPyM1ImMxDqP10zh1XWsfg6RWyfSRQXSw FULktgF4zgF31YYcYTcwNF/hS2OU+PmAk2g60nxMoSXv8qatZ6KGId6+wCZ0EWYTUViz rdDzmTyL0I2Q8HHAiwL5hRMwkrL8Lw/15o02vW9CD5SmUYWKUr83ZigvcMKeFS0uOuhN kWyjfC8RzHXZf1AXW+cpWu4aCfreXq8rwfUZIZqKcfUJbzqUmcitWSwDG7PYE6azh7o2 ES7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HRrV7TjTlPA/BkPaOPUYQ8wwbHiOpKT0qv7GK3Tslrg=; b=B+wO5DfKZrC/0jQ53RKORCPfLKbvLFjEEkaNudgsMxbk6f5Bt510RPPS104/5fPCAI npGNIS/Hon+779BhfYCILZGv/SnZagkMEAfg4HxblNBdmTY+jphCTtDg/1vU9TcJjAfF zoJRp82W2o7Y596kfwsNqWYqJCoz7ihTQUxjBT3G0/mniUqMnS0wYzLjNzPYvO94Kbwo EbjCH9WkQo+zw9KIfgiOkyuQkK6j7H6Hc2M2b9UhRsEZLcKZEtyoWmFoiOk5Ycu9ycy3 08SEQFIGsryXd0QB/dRLqjrRd+spK16bdpExNUsFKNBNEfVhn/kpuP6XZdgeNS+jIset XEtQ== X-Gm-Message-State: AFqh2kozbiIdcZ9eV1O+bCGccarJQkVdh03ynqyNoNFz+4XbZXJMFvE4 VAzw37uM+kcMrZ5qJQNtO+YsLwGiwMo= X-Received: by 2002:a17:90a:b798:b0:229:d641:9ef2 with SMTP id m24-20020a17090ab79800b00229d6419ef2mr46407332pjr.40.1675132439097; Mon, 30 Jan 2023 18:33:59 -0800 (PST) Received: from balhae.hsd1.ca.comcast.net ([2601:647:6780:ff0:3f41:4035:c56c:92cc]) by smtp.gmail.com with ESMTPSA id u13-20020a17090a6a8d00b00228f45d589fsm7640582pjj.29.2023.01.30.18.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 18:33:58 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , linux-perf-users@vger.kernel.org, James Clark , Leo Yan , Stephane Eranian Subject: [PATCH 4/4] perf test: Add pipe mode test to the Intel PT test suite Date: Mon, 30 Jan 2023 18:33:50 -0800 Message-Id: <20230131023350.1903992-5-namhyung@kernel.org> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230131023350.1903992-1-namhyung@kernel.org> References: <20230131023350.1903992-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756503793327037716?= X-GMAIL-MSGID: =?utf-8?q?1756503793327037716?= The test_pipe() function will check perf report and perf inject with pipe input. Signed-off-by: Namhyung Kim --- tools/perf/tests/shell/test_intel_pt.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh index f5ed7b1af419..4ddb17cb83c5 100755 --- a/tools/perf/tests/shell/test_intel_pt.sh +++ b/tools/perf/tests/shell/test_intel_pt.sh @@ -620,6 +620,22 @@ test_event_trace() return 0 } +test_pipe() +{ + echo "--- Test with pipe mode ---" + # Check if it works with pipe + if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf report -q -i- --itrace=i10000 ; then + echo "perf record + report failed with pipe mode" + return 1 + fi + if ! perf_record_no_bpf -o- -e intel_pt//u uname | perf inject -b > /dev/null ; then + echo "perf record + inject failed with pipe mode" + return 1 + fi + echo OK + return 0 +} + count_result() { if [ "$1" -eq 2 ] ; then @@ -647,6 +663,7 @@ test_virtual_lbr || ret=$? ; count_result $ret ; ret=0 test_power_event || ret=$? ; count_result $ret ; ret=0 test_no_tnt || ret=$? ; count_result $ret ; ret=0 test_event_trace || ret=$? ; count_result $ret ; ret=0 +test_pipe || ret=$? ; count_result $ret ; ret=0 cleanup