Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1770086ybh; Fri, 17 Jul 2020 00:04:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1znDHdoyzRnRypFs56Iyt8TRwPhpZcTKWwF5kFgBvSC4MFSMn6iLbn1JAPSTkQt+ERnRU X-Received: by 2002:a50:fd12:: with SMTP id i18mr8096856eds.371.1594969454477; Fri, 17 Jul 2020 00:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594969454; cv=none; d=google.com; s=arc-20160816; b=x0gczQBQvIEZF1Ui7TqUiZtBLOHxejEd9bEwdWN8A8k2d2aTeY16h6i7hel3PIQfGq z6XcoOWko0aeddoNFd8AP/SnVUGv6THEg8ySUeN4DueU+wAUT6xu0emXhUxlsPRbS9om GZK1wYEJVpU9YY4qRMmc1Eq7vp4YS3Af4EBOfXIIcyUdcCf4OTolreJF1gNNve4Z3i29 u80BsD0A1Qbrw5DxRP9hyBtprooKSMxelGy/Vqcl8AQquWivUUwg6VtzsXZL3jg+axAK nILXQ65U/CsDsSMtTfWcI9s061G+XUD9ZGjQ47sGksKKaYTSInmc6q6To/cXLg1+otp2 bpyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=nU/2DaMFFp2VGUZXOiG/gHzrF2Y+jQcIjHYSxEKv9EU=; b=kwSntW7RhyuUVE3UL6Z3nXXDB+zH/Db8kBlFsbtBcuDhvSNxA8Zz99znnnrmrjN/RY L16HltmDOdr0Eu02TkGmWk09k4DKKaqoUmNiky4y8nySafm5dFCxKCjtDFVq80psSCAr WBRsRQCUe9Csy2jAzU45eU84MaYwd+Z3HySm2Zb7T07sx8/yITsMTcIqV3hLRNmb9X/H pBakQL5jNzFejgYP6u2fqJp25sJcgYlv1ECg9/Orlg8QIcALq+Uv9xV5Jo61mzqNSAIM tABlvel33B3xBgNLQaTh6Ccq+Vo98SHu9GbIBtkE3E+ZtzlfVO/kID8eBQpaix6MPiBS hMRA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si4260182ejs.158.2020.07.17.00.03.51; Fri, 17 Jul 2020 00:04:14 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727042AbgGQHAw (ORCPT + 99 others); Fri, 17 Jul 2020 03:00:52 -0400 Received: from mga07.intel.com ([134.134.136.100]:41743 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbgGQHAw (ORCPT ); Fri, 17 Jul 2020 03:00:52 -0400 IronPort-SDR: gjHgQ7QMkvMVHq/k3WD0/8gd4p/mdMTUXjz2QiRu3CwrZgVNmzYnlZVe9/1ZIug5wnpBpyxmgR j+SpXFsDR76A== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="214267045" X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="214267045" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 00:00:51 -0700 IronPort-SDR: excIWyKBuPsVywzB44JOQNGAG097FGNNWK7aom+kfoAGF9Rig+OsSUqEHazktip9bflM8HNIeT 8V1BJwPuiAxA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,362,1589266800"; d="scan'208";a="486379083" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 17 Jul 2020 00:00:51 -0700 Received: from [10.249.224.34] (abudanko-mobl.ccr.corp.intel.com [10.249.224.34]) by linux.intel.com (Postfix) with ESMTP id 03DF4580824; Fri, 17 Jul 2020 00:00:48 -0700 (PDT) Subject: [PATCH v12 04/15] perf evlist: introduce control file descriptors From: Alexey Budankov To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> Organization: Intel Corp. Message-ID: <0dd4f544-2610-96d6-1bdb-6582bdc3dc2c@linux.intel.com> Date: Fri, 17 Jul 2020 10:00:47 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8d91c3a0-3db4-0a7a-ae13-299adb444bd6@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define and initialize control file descriptors. Signed-off-by: Alexey Budankov Acked-by: Jiri Olsa Acked-by: Namhyung Kim --- tools/perf/util/evlist.c | 3 +++ tools/perf/util/evlist.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index bcbe0cb8482e..36eb50aba1f5 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -63,6 +63,9 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus, perf_evlist__set_maps(&evlist->core, cpus, threads); evlist->workload.pid = -1; evlist->bkw_mmap_state = BKW_MMAP_NOTREADY; + evlist->ctl_fd.fd = -1; + evlist->ctl_fd.ack = -1; + evlist->ctl_fd.pos = -1; } struct evlist *evlist__new(void) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 38901c0d1599..fe1fe40e044b 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -74,6 +74,11 @@ struct evlist { pthread_t th; volatile int done; } thread; + struct { + int fd; /* control file descriptor */ + int ack; /* ack file descriptor for control commands */ + int pos; /* index at evlist core object to check signals */ + } ctl_fd; }; struct evsel_str_handler { -- 2.24.1