Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2411704pxf; Sat, 20 Mar 2021 15:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRZOhgr69J+DLs0z55Y1ekTdn83VIIXVA4OH6WkkW0YBOqXoQb8vzranyPkthxyP1MgC2B X-Received: by 2002:a50:9ea4:: with SMTP id a33mr17933832edf.295.1616278597964; Sat, 20 Mar 2021 15:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616278597; cv=none; d=google.com; s=arc-20160816; b=Af78lNofSKhmciaHcEukJAou0+pNyv2TtSob+KofHF9QZkLOIKiZTN+i90BY1n4Tes lKiWVGnyORt4v804IeMkyVJWoGtdqtEkDelJNqDgtkj30fYEYIjc62dcN9AVw/bMYe9f xUX7vgmQnFqR563ZEV1p84ElQB/BLqpu+PN8/8mUPCo1cXu+tYs5T2iNqJ6XoJTUiyfU +so49rBehDuV/gbTNo1pFSwiRNPif4yiXW1SezTUSJVQgE6o2/maeQ36toqwvBlvRlag RwcMLCGdzppDVfH0sSzrGP9x2aeQAUEQGzvEtY/I/YsjXGCBLNd5RJ2hr9KXPdhp7bGa 2ghQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=n0GgyVbUY8P+qsquNhSf/+UBGjy11LFxMYMtPA7PU9E=; b=ukuhBPR3xuwmmn4wg5l+a1QhNn1QmgXnAgWoHRKltB+ff+JR1aO2YXBtMz2BW4FtIN KJoqwHjfUd8QvNmREpDkjYWcfltuiCacwxGyQlNs7HSv//9znb/AZVoue72dNPeTZNxp Lrhpi94mFdSbZZ73oD25UvqT2alXsgColJifKMmGho+TBqjXXvuv4ZKSLtw+vhQeeH75 8eLx1ka/y4biyZegyt7kVTB4a0GR8l6Feu6bYDIUUxdHk+XyTHAYugvNVk6XgDKF3meF JdLprGajAzo+jrGWlliPs9zZMx+iQYDiJ6nGRmEm0oHDlVI7P8WaMQwLBdPQLRpQkbj/ 8LPg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg2si7673888ejb.233.2021.03.20.15.16.14; Sat, 20 Mar 2021 15:16:37 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbhCTWKu convert rfc822-to-8bit (ORCPT + 99 others); Sat, 20 Mar 2021 18:10:50 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:42832 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbhCTWK2 (ORCPT ); Sat, 20 Mar 2021 18:10:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-159-BETszJS_NFShJTUn66-nmg-1; Sat, 20 Mar 2021 18:10:21 -0400 X-MC-Unique: BETszJS_NFShJTUn66-nmg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDC5557081; Sat, 20 Mar 2021 22:10:19 +0000 (UTC) Received: from krava.cust.in.nbox.cz (unknown [10.40.192.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A35E65DAA5; Sat, 20 Mar 2021 22:10:17 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers Subject: [PATCH 2/2] perf daemon: Return from kill functions Date: Sat, 20 Mar 2021 23:10:13 +0100 Message-Id: <20210320221013.1619613-2-jolsa@kernel.org> In-Reply-To: <20210320221013.1619613-1-jolsa@kernel.org> References: <20210320221013.1619613-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jolsa@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should return correctly and warn in both daemon_session__kill and daemon__kill functions after we tried everything to kill sessions. Current code will keep on looping and wait. Signed-off-by: Jiri Olsa --- tools/perf/builtin-daemon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c index 4697493842f5..7c4a9d424a64 100644 --- a/tools/perf/builtin-daemon.c +++ b/tools/perf/builtin-daemon.c @@ -908,7 +908,9 @@ static void daemon_session__kill(struct daemon_session *session, daemon_session__signal(session, SIGKILL); break; default: - break; + pr_err("failed to wait for session %s\n", + session->name); + return; } how++; @@ -961,7 +963,8 @@ static void daemon__kill(struct daemon *daemon) daemon__signal(daemon, SIGKILL); break; default: - break; + pr_err("failed to wait for sessions\n"); + return; } how++; -- 2.30.2