From patchwork Fri Oct 5 15:48:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 148212 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp628026lji; Fri, 5 Oct 2018 09:04:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV60TYJK22k3XgnQd9jaB2nHTjJUkes+lH+59mJHc6lGkeu/uB2VdekuN1xYj6ooGbfQKT/ao X-Received: by 2002:a37:8b02:: with SMTP id n2-v6mr9821028qkd.157.1538755466628; Fri, 05 Oct 2018 09:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538755466; cv=none; d=google.com; s=arc-20160816; b=QkmjvIrLLkpd87bkk8Ici25bg586NXcw0Num4h28XEdkVPIt2GrN67NkrE1WYC70Hs NeFWmQse++eShX/kVoAyGqmvg4lsWdF5FBsJGsg93YuBxpTRHTn1wr4kvUi6fiVAuA67 ASQNr2n46neBO8OtNP8/nlHWKaF70AwmaG0i5XvWvz8TKjkuz51nfA7OHfq3pOHzj4kF GkTcyFZz4Bad1r3uFytDldpMbNxDldcSQeNzdOqmEiyI6YUxQXY1TkvopcVv/EgoJUqZ vJvH9NJjo+GkyqNCRfpqvcMhRz6iRa8UCMsie/I4t0MEjxLgc7V4QyzgnPJ2r6S212nP 8k7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=RwClpaYeTsig0GSvhAXa5GcqWP8NR/goGqm80e/f6TM=; b=oi/EwFAdP/0dy3+orEbh5dHzP3d+m0B+MJb6AyX9ZwBm7fgmYgtd0FT5357cKeBCDb GStUztH0HxnfjmwwnTzajVD3Q6onc8mYNPtMNqxDdB1wYZDixQMgknLIl4q/RjujSFua W25MHUyc71KZuYiJrvpHCdhCKhHaAGfC5qBjjVrofd91thWKwX40B/dSLjOV9gMgjr4q r5igZjp3dbBo+g8chGmB46d4kEe3dPgt9O2f2q+K5Z3Lk/fIEtPvy5emaZ2t53t4kPK9 s6J1y2GElNag7XVjaI6MZeoy+BAcXl3ZwhlQcd+3vvZI5dR5F64bpp7BaC/rQzMFwudD H/RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="h5tLD/aD"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e27-v6si876638qtm.339.2018.10.05.09.04.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 09:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="h5tLD/aD"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SaY-0005eN-3H for patch@linaro.org; Fri, 05 Oct 2018 12:04:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8SMF-0006fK-Es for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8SM9-0006FS-RH for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:39 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:36456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8SM9-00062Q-C4 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 11:49:33 -0400 Received: by mail-wr1-x435.google.com with SMTP id y16so14055736wrw.3 for ; Fri, 05 Oct 2018 08:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RwClpaYeTsig0GSvhAXa5GcqWP8NR/goGqm80e/f6TM=; b=h5tLD/aDMCpZZOhXI+A4YNCoDDWN+YUlpA6QCd7vNJDVByE+836swYrqY5wQ9AN8C2 TQ7TEJKctvgp505HiGSwVmBqcFK79ouMSfe7E67yKsRL7AbQ9Uw+lQcmoyoOxxouUiDY hOh0jXIPset7Z5EMae9djtH38oiroe6VgC+n4= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=RwClpaYeTsig0GSvhAXa5GcqWP8NR/goGqm80e/f6TM=; b=cj6mxzRiEMzcGq2kiljldEdE/TZMBQtTljuvwB4C1QC5PbHhO47UkCuRmXzdxY+xOx acq7aOzG9+w/7D3zDz8Ikk+zlC3uYoiR9RpxHkanC9bp+UDVnFg4+V9KLQ3Xne9GItHz tMSFRGVd33IFiKlZBk5exhypgu0zvawGlIOf9yM1HFXdtfSfcB9X5T33zxDFQbfJ0Y3o Dj7YbrzupQqRsfgXaQZ7mI+J1wzRFwPXCpjNt/SGO1sAybRjuNBWojBfQId0Lx2gZj3A TTgtzwR3lzZXw5Ynli6WhgT9Yg3bIYaFAZuYK65eQD0cyWQ7S7iTXldQo+aCRDOzgSYE QBgw== X-Gm-Message-State: ABuFfogb+mWMQw7/ubtNm/HOLZKMZJ4w4Ui6qbwtX50QhjybwJzuxToQ IYxBtOEO5le6qIoSPxbDbA3Wpg== X-Received: by 2002:a5d:6883:: with SMTP id h3-v6mr8696067wru.108.1538754556965; Fri, 05 Oct 2018 08:49:16 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d18-v6sm1617281wmb.33.2018.10.05.08.49.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 08:49:15 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 3386D3E0615; Fri, 5 Oct 2018 16:49:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 16:48:55 +0100 Message-Id: <20181005154910.3099-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005154910.3099-1-alex.bennee@linaro.org> References: <20181005154910.3099-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 Subject: [Qemu-devel] [RFC PATCH 06/21] trace: show trace point counts in the monitor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Hajnoczi , Markus Armbruster , "Dr. David Alan Gilbert" , cota@braap.org, Pavel.Dovgaluk@ispras.ru, =?utf-8?q?Alex_Benn=C3=A9e?= , vilanova@ac.upc.edu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now we have counts for each trace point we can expose them in the monitor when the user queries what trace points are available. Signed-off-by: Alex Bennée --- monitor.c | 5 +++-- qapi/trace.json | 3 ++- trace/qmp.c | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) -- 2.17.1 Reviewed-by: Richard Henderson Reviewed-by: Dr. David Alan Gilbert diff --git a/monitor.c b/monitor.c index c4677b502b..d8229cd2b0 100644 --- a/monitor.c +++ b/monitor.c @@ -1421,9 +1421,10 @@ static void hmp_info_trace_events(Monitor *mon, const QDict *qdict) } for (elem = events; elem != NULL; elem = elem->next) { - monitor_printf(mon, "%s : state %u\n", + monitor_printf(mon, "%s : state %u count %" PRIu64 "\n", elem->value->name, - elem->value->state == TRACE_EVENT_STATE_ENABLED ? 1 : 0); + elem->value->state == TRACE_EVENT_STATE_ENABLED ? 1 : 0, + elem->value->count); } qapi_free_TraceEventInfoList(events); } diff --git a/qapi/trace.json b/qapi/trace.json index 799b254a18..b9184b0d18 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -33,6 +33,7 @@ # @name: Event name. # @state: Tracing state. # @vcpu: Whether this is a per-vCPU event (since 2.7). +# @count: Current hits on trace-point (since 3.1). # # An event is per-vCPU if it has the "vcpu" property in the "trace-events" # files. @@ -40,7 +41,7 @@ # Since: 2.2 ## { 'struct': 'TraceEventInfo', - 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} } + 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool', 'count': 'int' } } ## # @trace-event-get-state: diff --git a/trace/qmp.c b/trace/qmp.c index ea99b00956..cce8198091 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -102,6 +102,7 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, elem->value = g_new(TraceEventInfo, 1); elem->value->vcpu = is_vcpu; elem->value->name = g_strdup(trace_event_get_name(ev)); + elem->value->count = ev->count; if (!trace_event_get_state_static(ev)) { elem->value->state = TRACE_EVENT_STATE_UNAVAILABLE;