Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp359835imu; Mon, 10 Dec 2018 23:42:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vyx+aZkaS9O9fsJksEbOOrIZsjt6/NYHMfZAiTAWAhrhm0EFkM4D9RmLsIm9nrqJG1I9iw X-Received: by 2002:a17:902:2a66:: with SMTP id i93mr14772581plb.113.1544514160334; Mon, 10 Dec 2018 23:42:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544514160; cv=none; d=google.com; s=arc-20160816; b=uOJmclSts4ZG1Aag4BhfpZ0KyeBuua+uMSvP1Z62X2rnrbhI9V5q1Tulhhdr8Mcdhy 9ryUK1RjZXnTqDBb2xkKxFzz6rjpRTuDAbvPL5oMx4quFn7N2Owi2aaYSA+Ne+/EvWDz u1rCQNNO9T8I3t9/tIIuR+c3zmBq5oC92b6QMMwR2Y7YIamCSY4Io7CFltN1y8Dl5rGn TucwOLsV80omUjBuwiiAQKdSpdJezh+KqQBLxac8cdP2MSF+7KjgL8owxfuGr3N3QMnN sJy/+S7KxF2xMxL35wNzHL8F+e4JUXwHQ+pctmpl3gtD+ivvFcxFjW5sSxuDnuUkWNnN G9Pw== 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 m32si12118476pld.86.2018.12.10.23.42.25; Mon, 10 Dec 2018 23:42:40 -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 S1726289AbeLKHky (ORCPT + 99 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(-) 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); -- 2.7.4