From patchwork Thu Dec 14 17:47:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 122014 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp7115983qgn; Thu, 14 Dec 2017 09:47:08 -0800 (PST) X-Google-Smtp-Source: ACJfBotLeEekrcOUiJ9m16r/cpNgwtytKPUpTLI8o2KetU8xehfY97PSAE7SlHwoiwR51+nw1i8E X-Received: by 10.84.234.135 with SMTP id n7mr9845032plk.298.1513273627986; Thu, 14 Dec 2017 09:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513273627; cv=none; d=google.com; s=arc-20160816; b=mv0xcG9bEViz6yvYZg27rAS4fzKLxrPoAPNHdC2JxOEQs2ddfcjxKkMBObv1TA6XTG Y+JmZ5mUqocmH1vjlHlloB7vqa8bamP1mwGgehvkcSdpWQ5i8YOwUyVIyGvDLW2FCqNh 1ZF2uXUGsklrM9muk7GUUth1+bWTowPyuWr4FSfW3sOcyoUzHbiWmiuOPi53Ls2+Lv1Z 5CdFo+l4px/Fs7U5xDzH8ieqIrNRLw6pbMPQioQI9TU3rn3AmQNuezP+5y8DUNJrJTSV DG0rLU9PYIhpkDr4E+1xw5ZIEe27LKH5Q+EAjRc9HlNfo8wsjTb+CygEo8gVjXs4X+iN +93w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ae/YpeDtearhwA8B77VE5Lp9xYN9llaoEtFi1lRM+OU=; b=SwLP5BggiKy9YoYhh622usuD//FAhzVkRL9DZ/b76Q5rb6n2lK2/DB80tamlXLiUqi tWo0qdsn5t1gJGdn33kZCiyXxYA+Tc0yHxotj3PvoDeVHIdQdiR+2i1gpC5L5A2HAP9p 0z4tjtGvtudXwIxgcc/xcJ3zeyg2U45ggIMI02KdwxunuDjwJ6VBjKbTQjT1L7ZcbOWn J3biM0t0Zi+4ptchU3EIyz1sfkKak8n1QdEPM16M1R4kQpPzM9Tv7UYG1mlMS1c2dYvU rmKCuWtJOoJN2yF+vEGGtWyQ3cDsQj7rF+vt/IZykHihN7iZb5Xh4LMkFrpyCavsCltT TLSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NPIYU+zQ; 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 r80si3558747pfa.323.2017.12.14.09.47.07; Thu, 14 Dec 2017 09:47:07 -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=NPIYU+zQ; 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 S1754465AbdLNRrG (ORCPT + 20 others); Thu, 14 Dec 2017 12:47:06 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:41298 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753950AbdLNRrD (ORCPT ); Thu, 14 Dec 2017 12:47:03 -0500 Received: by mail-it0-f66.google.com with SMTP id x28so13374552ita.0 for ; Thu, 14 Dec 2017 09:47:03 -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; bh=ae/YpeDtearhwA8B77VE5Lp9xYN9llaoEtFi1lRM+OU=; b=NPIYU+zQ+c3S+haA1rKRMohWAc66rW9ctJ+KCDG3cvh0O+PSFovMnCjyP7HZFHeiAe pKGJPkEstbEOXhJGMpW9jHrYhqZzapK/wnr53d4dCCTeDbNEHk0x6WTcl0eQf4ma1UWG Kt7Ur6Gk3HxDHkEWByj1trHt8J/fFpZKbuNvw= 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; bh=ae/YpeDtearhwA8B77VE5Lp9xYN9llaoEtFi1lRM+OU=; b=G2LUomAp6uIa2oSJeb/9QDZeW3e0b8vCqXuFCKwhp/F3yUjeriLTDbupPV60qIl+a5 7n9EZSntdYpTM7r5+qsogeKCqYpcgMUG+vQFdAEH3MHTyL/uquECNmJC5hTzO4L7jr+G c+I+qX2fwsNGJw/9oEaZT3GKEBnwTjbZjZKxuXK16loqdMj/x9gmgihPffcslS/2oruT mlBQu4gX8rI7IQBpqNYdVIaBTAsCnPksjugK+3SG2EY1CZIq7e8TIGPLwKncRdUBcNLM tgW+rGYxPrB8m3UrRCEFBcdt+kTru/wJWOz7w1alaRS3SehSnZWrFDXoA7X1aVQI5nhT BVjg== X-Gm-Message-State: AKGB3mK5BMssG22z3JxHF9z8QCY4yczxtLIJVrSHbJs9Es8aJZK++aEz Ed9TvhzEqaNWm9HzzmZlQVaxrA== X-Received: by 10.107.112.13 with SMTP id l13mr8233869ioc.72.1513273623244; Thu, 14 Dec 2017 09:47:03 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id e79sm337525ioj.77.2017.12.14.09.47.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Dec 2017 09:47:02 -0800 (PST) From: Mathieu Poirier To: jolsa@redhat.com Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH v2] perf report: Fix regression when decoding intelPT traces Date: Thu, 14 Dec 2017 10:47:00 -0700 Message-Id: <1513273620-3351-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit (93d10af26bb7 perf tools: Optimize sample parsing for ordered events) breaks intelPT trace decoding by invariably returning an error if the event type isn't a PERF_SAMPLE_TIME. With this patch the timestamp is initialised and processing is allowed to continue if the error returned by function perf_evlist__parse_sample_timestamp() is not a fault. Signed-off-by: Mathieu Poirier --- Change for v2: - Better handling of error conditions as suggested by Jiri. - Slight modification of the changelog to reflect the above. --- tools/perf/util/session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 Acked-by: Jiri Olsa diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 54e30f1bcbd7..eb59dc7c7314 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1508,10 +1508,10 @@ static s64 perf_session__process_event(struct perf_session *session, return perf_session__process_user_event(session, event, file_offset); if (tool->ordered_events) { - u64 timestamp; + u64 timestamp = -1ULL; ret = perf_evlist__parse_sample_timestamp(evlist, event, ×tamp); - if (ret) + if (ret != -1) return ret; ret = perf_session__queue_event(session, event, timestamp, file_offset);