From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752773AbbIRGMK (ORCPT ); Fri, 18 Sep 2015 02:12:10 -0400 Received: from mga11.intel.com ([192.55.52.93]:59922 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbbIRGMH (ORCPT ); Fri, 18 Sep 2015 02:12:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,550,1437462000"; d="scan'208";a="564044949" Subject: Re: [PATCH] perf tools: session: avoid infinite loop To: Mark Rutland , Arnaldo Carvalho de Melo References: <1442423929-12253-1-git-send-email-mark.rutland@arm.com> <20150916205454.GI11551@kernel.org> <20150917154152.GD12808@leverpostej> Cc: "linux-kernel@vger.kernel.org" , Ingo Molnar , Jiri Olsa , Peter Zijlstra From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <55FBAA8C.2020703@intel.com> Date: Fri, 18 Sep 2015 09:09:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150917154152.GD12808@leverpostej> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/09/15 18:41, Mark Rutland wrote: > Hi, > > On Wed, Sep 16, 2015 at 09:54:54PM +0100, Arnaldo Carvalho de Melo wrote: >> Em Wed, Sep 16, 2015 at 06:18:49PM +0100, Mark Rutland escreveu: >>> This has been observed to result in an exit-time hang when counting >>> rare/unschedulable events with perf record, and can be triggered >>> artificially with the script below: >>> >>> ---- >>> #!/bin/sh >>> printf "REPRO: launching perf\n"; >>> ./perf record -e software/config=9/ sleep 1 & >>> PERF_PID=$!; >>> sleep 0.002; >>> kill -2 $PERF_PID; >>> printf "REPRO: waiting for perf (%d) to exit...\n" "$PERF_PID"; >>> wait $PERF_PID; >>> printf "REPRO: perf exited\n"; >>> ---- >> >> So, I run it here, without this patch, and get: >> >> [root@zoo ~]# time ./repro.sh >> REPRO: launching perf >> REPRO: waiting for perf (766) to exit... >> [ perf record: Woken up 1 times to write data ] >> [ perf record: Captured and wrote 0.015 MB perf.data ] >> REPRO: perf exited >> real 0m1.060s >> user 0m0.018s >> sys 0m0.037s > > [...] > >> What am I doing wrong? Trying to reproduce this before even looking at >> the patch :-) > > I suspect you have a shinier computer than I do! ;) > I imagine you would also need to contrive not to write any synthesized MMAP or COMM events i.e. no access to /proc perhaps?