Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3303867pxj; Tue, 11 May 2021 01:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMIl/fkJVbA5Xk4YycrVZ5hzPmENEu7u3SdOsYbTLVrr4ttH29+f8eQ2nmnCRwhdWXwdD/ X-Received: by 2002:a05:6402:341:: with SMTP id r1mr34494967edw.113.1620720470067; Tue, 11 May 2021 01:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620720470; cv=none; d=google.com; s=arc-20160816; b=P//R5+miZaB6WChGxTXM5Urzq4VLIR8ITPpWbg6vqDlbGIOx58LAQU8VubLSADsKQa gQMN7XwvfPmDjl5vaguycl+SqId/PIVVYnljXLZC9rnObVBIr1NVY4DVGshd2oBGjgJt Pl4JWVe457Amfwx0o+O6xMcTHb2WR6MtojniJwEkXnHtalZFqgF4dWsl5KR7VcehKyGS hDHson5q4nI2u29P4+KIuSpSDUug3RwoVHUehm2jXLOAnqW8v+36BiuN3n07dA7tJeFZ 30qRWnFMIClxBIX3AcXqd3zwsjId8MXrYlGwORq849/EimnvONOY3Evt26Fh2Mei3etm i8qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=owL/4Levsbr9ZSdMY4wPEiIgPr6GonMYfwkwZ8+sBwc=; b=nAyumDpoKdWnin7XMpu0exc2dSbVuo7yh06CUBwgsTWjbDRusYl6MBGJFfU1KZqd8v dWAfR7TJPV81VaIYxMifH+dz1lYbC5nRuEOd4eyH6FttQTx6bBm6/3aMCxGjHBX2t3TR 1NHnuRLqwwmVtIT7FPx+DVjxpVfx31IGDGJW7zxpzfac16722KhO/9ak4xHllV5eWWaX IoJ8Fd+xTTD01yNGKO7MNPug9r2pA183XktkA7x552aqoG31q/hHoiljmDlfZK700Mgf AmvOmH6L699zy35gXk14oHfAgGB3GajM6ru+nr+IFBc1oeAbb4byw96xlsbpVTqQ/NXl W0TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WdsVMzw5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si16164440ejb.338.2021.05.11.01.07.26; Tue, 11 May 2021 01:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WdsVMzw5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbhEKIH0 (ORCPT + 99 others); Tue, 11 May 2021 04:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbhEKIHW (ORCPT ); Tue, 11 May 2021 04:07:22 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E857CC061574 for ; Tue, 11 May 2021 01:06:15 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id i190so15443224pfc.12 for ; Tue, 11 May 2021 01:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=owL/4Levsbr9ZSdMY4wPEiIgPr6GonMYfwkwZ8+sBwc=; b=WdsVMzw5hMV3bpevyN4y/+8vNyWJPzr8NHJEo7BFpTmqs+8FT6YlbQUBVryuJ4fWul v2u0iA/uN6aXvyuG6a9l92kUtS0KQvwWtUntXwFiTreAedIkwLDK44GOvT4gTqTxH8mh 9otyMAuHnoEskR24vEZHE5yQnVl5LgxzU0wkreU5hq2Xn7BFc+Z0kBn000Ila/bdjk9o 2VZmIBcHb2ZgkeK2gBk+V2/O+EqIk0y4Sn8U4TLAPEYUWGDNVIJkQR6dAZrFUZFOlirD iTKg9UJ8CXzNuCRMmoN5yb10JdCRrs7zS3zivhAraGN2F3j00nIlYihaqs4+aq7SKb+Q cBcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=owL/4Levsbr9ZSdMY4wPEiIgPr6GonMYfwkwZ8+sBwc=; b=gDvNuJwuZv/OyB4lDoW6623xkMXLShNOs+bB6imImkZAogzj922tZs+KoflR3Fo0si gpVYCE+zmwZ7vGyIwJO0lt8mTK6Ba/yeQ9iTpukS2LGQ6s18ti90WQB6fhkB3zAVucAc 2IP8n8EqTgGgcQNVUQQiEgl/57ExfN2yF1m+vLozYMWJtO/QRE7GJ/KEWggNHOtM4XcS bqhd5USn2YR6h1vcpHm4aIGo+maLyUznm9neam4R0W/1LCKmK1AF7L8xw6nPWM33UoBa /SQ2JoitohMV7sCvpS50S/JTPAZrXoMu/g4dWF+afl+Nxn3JHMhOFChf82HOBAbZIdsA x9xA== X-Gm-Message-State: AOAM530WICBONC5grztst+jvzEvnG8s8Rs0cnjP4k8qkI/L4i7h0WKth m9s4740fYRTtd8JQIlf6FmH703KoxOKbHbNg5TUCgg== X-Received: by 2002:a63:e918:: with SMTP id i24mr29602351pgh.118.1620720375143; Tue, 11 May 2021 01:06:15 -0700 (PDT) MIME-Version: 1.0 References: <20210507095814.17933-1-james.clark@arm.com> <3926c523-3fdb-66de-8b9c-b68290a5053e@arm.com> <20210510053904.GB4835@leoy-ThinkPad-X240s> In-Reply-To: <20210510053904.GB4835@leoy-ThinkPad-X240s> From: Denis Nikitin Date: Tue, 11 May 2021 01:06:03 -0700 Message-ID: Subject: Re: [RFC PATCH] perf cs-etm: Handle valid-but-zero timestamps To: Leo Yan Cc: James Clark , coresight@lists.linaro.org, Mathieu Poirier , Al Grant , Branislav Rankov , Denis Nikitin , Suzuki Poulose , anshuman.khandual@arm.com, Mike Leach , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leo, > Just remind, as Mike has mentioned that if the timestamp is zero, it > means the hardware setting for timestamp is not enabled properly. So > for system wide or per CPU mode tracing, it's better to double check > what's the reason the timestamp is not enabled properly. The bug is confirmed by HW verification. > > IIUC, this patch breaks the existed rational in the code. Let's think > about there have 4 CPUs, every CPU has its own AUX trace buffer, and > when decode the trace data, it will use 4 queues to track the packets > and every queue has its timestamp. > > CPU0: cs_etm_queue -> ... -> packet_queue->timestamp > CPU1: cs_etm_queue -> ... -> packet_queue->timestamp > CPU2: cs_etm_queue -> ... -> packet_queue->timestamp > CPU3: cs_etm_queue -> ... -> packet_queue->timestamp > > The issue is if all CPUs' timestamp are zero, it's impossible to find > a way to synthesize samples in the right time order. Is it really impossible or it just can lead to incorrect decoding? I verified the profiles generated with zero timestamps and this patch on Trogdor (8 CPU cores) and I don't see any significant difference in the quality of the AutoFDO profiles. If mixed packets don't cause errors in reconstructing the branches but instead mess up with their timeline then it probably won't matter for AutoFDO which just collects statistics of the branches. What do you think? > > [...] > > Thanks, > Leo Thanks, Denis