From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003Ab3EJILY (ORCPT ); Fri, 10 May 2013 04:11:24 -0400 Received: from mail-ee0-f44.google.com ([74.125.83.44]:42178 "EHLO mail-ee0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519Ab3EJILS (ORCPT ); Fri, 10 May 2013 04:11:18 -0400 Date: Fri, 10 May 2013 10:11:13 +0200 From: Ingo Molnar To: David Ahern Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org, Frederic Weisbecker , Peter Zijlstra , Jiri Olsa , Namhyung Kim , Stephane Eranian Subject: Re: [PATCH v2] perf: detect when perf.data file not closed out properly Message-ID: <20130510081113.GA6823@gmail.com> References: <1368127643-9913-1-git-send-email-dsahern@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1368127643-9913-1-git-send-email-dsahern@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * David Ahern wrote: > perf-record updates the header in the perf.data file at termination. > Without this update perf-report (and other processing builtins) cannot > properly read events from the file -- the algorithm in > __perf_session__process_events depends on the data_size which is read > from the file header and that function loops if data_size is 0. > > Catch this condition when the file is opened and warn the user. > > v2: put error message on one line > > Signed-off-by: David Ahern > Cc: Arnaldo Carvalho de Melo > Cc: Ingo Molnar > Cc: Frederic Weisbecker > Cc: Peter Zijlstra > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Stephane Eranian Acked-by: Ingo Molnar Thanks, Ingo