From patchwork Tue Dec 11 07:38:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 153400 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp324877ljp; Mon, 10 Dec 2018 23:40:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/XGzTIM3EzKh5936QN41YVF79a0BxYeV0YQffFRGiE3CFzdYpAPVN9jN6cYwPZCwHfgt853 X-Received: by 2002:a63:2849:: with SMTP id o70mr13392913pgo.155.1544514057232; Mon, 10 Dec 2018 23:40:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544514057; cv=none; d=google.com; s=arc-20160816; b=S7QJ71FdgnEPkupWY7BvZptAlgCFD32dwEvKf4wKNjlLTCkuyLwuAl0EN0wFws5E9M Y4670wo1eBcqpNzZuVtNX7fVw1U+usnSOEA0h/rj11aJWg5WMH903om5C2BolxKOBkN3 RrQtGzvAkKj0JlXIeocUtcxzjbcv1XwvzFejk+V5VKuVZOLvC3ROKOLqVHqLsvZqQlt2 8s89Vy1JM6QMNsbWbbcmg6Ye+tTlzalZrNnKS+dRZ8Yj1YwOxh+2e3L3ZJ1eT+Bm+7Qp 99LZNczZfsVyIRp/Z5jTPNt9DshDayi1hQm5DTUJdYbAdCx+wb10PdJ5VjghmBcxQmDF Xj2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=s6aboUTCwaj4TA/VXlzMLvpQGBMMzsatHH0Kix/jICo=; b=Kvlj1vRKfDeSxS5uMZc8OlHClKaLCVZoGw+NqJr6SwFScS4lvBX2HdCy+aHRxcxs2x u6Puky7T4YaXRKH4/e4RYadMls35AKUFKKsa86ztkkj+rf70+RymWihirD9TgyOKQAzX 1g+JgQjQAgmGxpqLiZxtTbyivzLw7bFOdJ1QNnkWUPeMbRR8U3xH3ZRG36pL7B0ZEbo2 TidGtDlhFcfnSX7ercHxhnzldQw2qUYmMUPFysxzLmG3msGSg6Dq2TOFjTOG0+kEyrHW XI7EdfPxs4XrwdxKUYGDJpOrW6g8Yfldcee2bJ2jT2Q6uA+x14ZEsKp9E4BxRWODs36H rmHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J+dbz6iU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si12268238pfy.29.2018.12.10.23.40.56; Mon, 10 Dec 2018 23:40:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J+dbz6iU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbeLKHky (ORCPT + 31 others); Tue, 11 Dec 2018 02:40:54 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34957 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbeLKHkx (ORCPT ); Tue, 11 Dec 2018 02:40:53 -0500 Received: by mail-wr1-f65.google.com with SMTP id 96so12986694wrb.2 for ; Mon, 10 Dec 2018 23:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s6aboUTCwaj4TA/VXlzMLvpQGBMMzsatHH0Kix/jICo=; b=J+dbz6iU8ewWu0saYvBbMMYJmMeQuz/VHbn5m1CTalri8JzMCpqLROwpq1G3yGAVEO l5kxfqbZMF8o4TnNe04jEiR1zruc+MyFPibD5YXTW22GzWPgSsJJQ7UYp/KOWP8A5MlS Oi++7stK9UD7kswvx/7HRXrnxdmGTa6aousv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s6aboUTCwaj4TA/VXlzMLvpQGBMMzsatHH0Kix/jICo=; b=LioBf3d470oEWzFcy4JYiWw5erk0AgIpT2YelX/adWRn8wgFWJogTL0/6qiVSFsItc 9a2fGD7tdtXDgWJNLHY0ufnkI/S+WaFpYzFChuISJ9izLn+bCX/XMqIptnEHAq06JgOt kfFNGEUgBCg/Aooae8PImguN6zZSiG5VnAY5RX+xnNOJti/Vr8mgOxcuTudKhfoAHn9z G/UFYGE/ZWS1/S5fxdbSu1o5p7e9Q715Kq3Xuk2IrPkPDtJKHIsziE5y7wf9WPlFWy/9 +W3oyBEkaU1V3lP9CGf8pEkRCmqMaop29j1Mb9gLOu341MddmHK3dlL7GC6jmGa2w6+r p+Wg== X-Gm-Message-State: AA+aEWb6iu8DfdO6/yFOlb5wkI+vFD4s51XXqD8ed+Crg+iadX8r5+IV LJFDqfn6WCu0JMQlORPXQUVOKw== X-Received: by 2002:adf:f308:: with SMTP id i8mr11822984wro.219.1544514051589; Mon, 10 Dec 2018 23:40:51 -0800 (PST) Received: from localhost.localdomain ([209.250.228.18]) by smtp.gmail.com with ESMTPSA id k7sm14186961wrl.51.2018.12.10.23.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Dec 2018 23:40:50 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Coresight ML Cc: Leo Yan , Mike Leach , Robert Walker Subject: [PATCH v3 6/8] perf cs-etm: Treat NO_SYNC element as trace discontinuity Date: Tue, 11 Dec 2018 15:38:26 +0800 Message-Id: <1544513908-16805-7-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544513908-16805-1-git-send-email-leo.yan@linaro.org> References: <1544513908-16805-1-git-send-email-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CoreSight tracer driver might insert barrier packet between different buffers, thus the decoder can spot the boundaries based on the barrier packet; the decoder is possible to hit a barrier packet and emit a NO_SYNC element, then the decoder will find a periodic synchronisation point inside that next trace block that starts trace again but does not have the TRACE_ON element as indicator - usually because this block of trace has wrapped the buffer so we have lost the original point that trace was enabled. In upper case, it results in the trace stream only inserts the OCSD_GEN_TRC_ELEM_NO_SYNC element in the middle of tracing stream, but we don't handle NO_SYNC element properly and at the end users miss to see the info for trace discontinuity. Though OCSD_GEN_TRC_ELEM_NO_SYNC is different from CS_ETM_TRACE_ON when output from the decoder, but both of them indicate the trace data is discontinuous; this patch treats OCSD_GEN_TRC_ELEM_NO_SYNC as trace discontinuity and generates CS_ETM_DISCONTINUITY packet for it, so cs-etm can handle discontinuity for this case, finally it saves the last trace data for previous trace block and restart samples for new block. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index 1039f364..bee026e 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -410,7 +410,6 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( case OCSD_GEN_TRC_ELEM_UNKNOWN: break; case OCSD_GEN_TRC_ELEM_NO_SYNC: - break; case OCSD_GEN_TRC_ELEM_TRACE_ON: resp = cs_etm_decoder__buffer_discontinuity(decoder, trace_chan_id);