From patchwork Tue May 23 12:49:51 2023 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: 684907 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697678wrt; Tue, 23 May 2023 05:50:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kpbdTzYl2BNzpBzHVkFstcgm5C/rHfSMcMfxyPfl43NzRamMl88GOE82CCzGJPJxjwYOm X-Received: by 2002:a05:620a:4883:b0:75b:23a1:8322 with SMTP id ea3-20020a05620a488300b0075b23a18322mr4252331qkb.29.1684846226669; Tue, 23 May 2023 05:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846226; cv=none; d=google.com; s=arc-20160816; b=Kc/p6f/t6WsNKp12XI0z4gnDXXbEpEHedszPDS44oXp8Bqmge9RkPjzum5poiTCTAU lEPN4HtZ0eocv0thLjrQq824s99xmwq648A3PWlp8BgAGWMjoTxJ6sP8W+WOs0Oa9AWN a10k4ctR0vr+eZRBVpxmliBV+H+9cGW1OfveG7p3//ioQmSDLiILDYvDVm4p+VAUSs1f M/Cucws2BR4kgreBZPFhXmbRyfqRneAxDXvKCtnjP2FLwvKi1RLEof7lJcwRwjgRPes2 AkxK1R3u+1TjpkcitBmQx2BgGdpKfETswKTUqGjxQMzpniLKle1p/1dxdtduUjJ4XRWJ Db2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=S/veFkqHT/dw0FGJJUyyIccgoBrtEsmhnjffjm4XDmhjS2iGjMwrk69D2l150943N5 M3qat2t4J3ytUXxfJY5C/UrqHFWEjKtyBIFgQ2psamPZZyMpfhLOQ40U25kSO4fHKmU/ YdcpbJHsNQXcGJlIp2YmHvpIrcYpOcG2USZz9UfpQ6PToJAQHBdcAC0hYM2tUAxJpzu6 tfxz3mU7QOprbgScAqgRmsAqm+LUsuCWxjKdPs3q+lI9E6Hpo7J0SaRDfu4PKtr8JVbL Wkj3+UfKp6i7MhSGpZk1llxXgo4eyBNPlLaU2De1TY6kdG+a6N5jB/Td/no22gO+y6Ql K35Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJP1g4Rt; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id h17-20020a05620a13f100b0075b286c952dsi786169qkl.693.2023.05.23.05.50.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJP1g4Rt; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846225; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=hJP1g4Rtx+eAGP7rc4Vl7Ab6OUpf/srtAIUiQzxmXNKfJloCqjVL9OPAbirxOoXLJVC9DB zY3UBYeUeuFMOUD8MgOZE9S4EvFtRCAte1Qc4bUiMhXGYE4ZkBpQXfX57bD6wVxyQdQ91Y 0AYi5S4y3Kmv7d3m2mShv/IdR5/NDU8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-7080bhWrM96d0K7HhGj45Q-1; Tue, 23 May 2023 08:50:21 -0400 X-MC-Unique: 7080bhWrM96d0K7HhGj45Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7FE76280AA20; Tue, 23 May 2023 12:50:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 698CB9D7B; Tue, 23 May 2023 12:50:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 15A7F19452C5; Tue, 23 May 2023 12:50:13 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 21B351946A44 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 170EF40D1B64; Tue, 23 May 2023 12:50:07 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F8F140D1B60 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E01F8185A78E for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-497-3cmvtiYaNDOgTJdYiwHIrQ-1; Tue, 23 May 2023 08:50:03 -0400 X-MC-Unique: 3cmvtiYaNDOgTJdYiwHIrQ-1 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3f42d937d2eso46738705e9.2 for ; Tue, 23 May 2023 05:50:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=A3sLFMC4eyo3fxWT/KyQ8nkSp9/dnxDIujeWXjaf9vWiTqsQJPePNDIwcD/gMklBJO +6F1RQp/VOtvIyg58cGk/rrFyWdwDfupe2moY2SIProsxQFZcDb3DGKS3EnTtu3oTvFa GbcoceheaKKqNb2tbhKchdnezzLy2t6mGw7vjxfURkPkzZD8S5xAe2i5Ygz5MWL2Z/v2 Ocmss3Ar1ig5VdA00gbGHTmT1QUin+whVDhS5m3VqSL4rrtZvUQcio3+5gln6xPM6gYT IQDizlQ4bR+g4lfz40l9ZhbT79bcd+SgDSoUPhPCoZB57gOhkXwh2540S8RbDlRjDB6q Xlgg== X-Gm-Message-State: AC+VfDy94q4Jt/ppPIK1wSSbUVEdyxYqY8FTU0A2DoB8S4WmyC3LQDZw WxK+jv00kzfmMTRcjVUlwDzLfA== X-Received: by 2002:a05:600c:3797:b0:3f4:2819:7777 with SMTP id o23-20020a05600c379700b003f428197777mr10079447wmr.38.1684846201838; Tue, 23 May 2023 05:50:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v16-20020a1cf710000000b003f4fe09aa43sm14973884wmh.8.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:01 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0AE011FFBC; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 01/10] *-user: remove the guest_user_syscall tracepoints Date: Tue, 23 May 2023 13:49:51 +0100 Message-Id: <20230523125000.3674739-2-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This is pure duplication now. Both bsd-user and linux-user have builtin strace support and we can also track syscalls via the plugins system. Message-Id: <20230420150009.1675181-2-alex.bennee@linaro.org> Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-2-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-2-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- include/user/syscall-trace.h | 4 ---- bsd-user/freebsd/os-syscall.c | 2 -- trace-events | 19 ------------------- 3 files changed, 25 deletions(-) diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 90bda7631c..557f881a79 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -26,9 +26,6 @@ static inline void record_syscall_start(void *cpu, int num, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { - trace_guest_user_syscall(cpu, num, - arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8); qemu_plugin_vcpu_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); @@ -36,7 +33,6 @@ static inline void record_syscall_start(void *cpu, int num, static inline void record_syscall_return(void *cpu, int num, abi_long ret) { - trace_guest_user_syscall_ret(cpu, num, ret); qemu_plugin_vcpu_syscall_ret(cpu, num, ret); } diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index c8f998ecec..b0ae43766f 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, CPUState *cpu = env_cpu(cpu_env); abi_long ret; - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); if (do_strace) { print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); } @@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, if (do_strace) { print_freebsd_syscall_ret(num, ret); } - trace_guest_user_syscall_ret(cpu, num, ret); return ret; } diff --git a/trace-events b/trace-events index b6b84b175e..691c3533e4 100644 --- a/trace-events +++ b/trace-events @@ -85,22 +85,3 @@ vcpu guest_cpu_exit(void) # Targets: all vcpu guest_cpu_reset(void) -# include/user/syscall-trace.h - -# @num: System call number. -# @arg*: System call argument value. -# -# Start executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall(uint64_t num, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7, uint64_t arg8) "num=0x%016"PRIx64" arg1=0x%016"PRIx64" arg2=0x%016"PRIx64" arg3=0x%016"PRIx64" arg4=0x%016"PRIx64" arg5=0x%016"PRIx64" arg6=0x%016"PRIx64" arg7=0x%016"PRIx64" arg8=0x%016"PRIx64 - -# @num: System call number. -# @ret: System call result value. -# -# Finish executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall_ret(uint64_t num, uint64_t ret) "num=0x%016"PRIx64" ret=0x%016"PRIx64 From patchwork Tue May 23 12:49:52 2023 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: 684904 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697602wrt; Tue, 23 May 2023 05:50:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FJJF15q4yU76VQnXzY0VABa58V1qNu/7g+xvGl4JEvKT5P72asZcNvjBG5hpCQxZ6wdf+ X-Received: by 2002:a17:906:ee82:b0:966:37b2:734a with SMTP id wt2-20020a170906ee8200b0096637b2734amr12749995ejb.22.1684846219173; Tue, 23 May 2023 05:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846219; cv=none; d=google.com; s=arc-20160816; b=jEm1zvj72+Fr3eLulIoC7Ojv6Q3s89U3j0i/r2vga1r6ef7Mw+CtIA64/I706xJ1ft P0MQEwypAf2te8o3sUwmAyWPwYa3VYGbKUCe2GuYe3Y7nozVgVqUVr0p6q9Awxc3JsGd gaAH5SdQ1QnyJRhJ5lSl5NBsD9WzKGJEVii5bIFztQtSJX4waED4q2BZATXSHnWdSGVm +YeSfYlbaMwOSXlUNLPuXXCl1pmoew0MirUyA8z+Fu8Mb9d8M+FBMRJFIPXNhLBSj3/F 8Ahs+ZDqRey1dgOrgFp1bD6rStU13UWaEkOxx5G30g14YvLLI3hCHSwOBDUlWduVZm1j vJlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=eI2rXk6QZdXXt5yXSNlb9A2BDCVNKgeMG4tUcOtMyTUjXGBtsS73gPYe+3sPW1cpxX 4r9sCSTFzZ8IfOcOxU9D8QvcxxYpJZhEXOViw0zzvvk7tjo9lKf7g0BpxTlH7VclABvR sxCNBYnvBvi6nY7YWQesREi3a4+Zg854k23Y6L/W1R8KcoIV5U5ZWcq+KzCmkSNgDAmu ru6NEXX5W9fZKWfGqZUBaU8lhUx7bNgXuN5zic62SX49Uj13J7JpeetMdLKZ0Izs3ffS aUSeRHiGidsPcBQX9f9lREZ+uxQmTzSTl1n60D5sYjCk8GHmE2r6osDKH2aNju+6IhxF VmQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/4kS6K/"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id o20-20020aa7c514000000b00506b2a534fcsi2837156edq.85.2023.05.23.05.50.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/4kS6K/"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846218; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=Z/4kS6K/GZaBxdzf0FryZbjbv5bTbovAilnL+gcTHweggB7dxXf9dF6X8Pv47+ze430Xg7 5J2PIyShCjnVdZeaht0JwiocMCxkOWbZQLlZX2HQab/Hk+07vTgIneuvt2oMiq1QXSN1fa 8cKQwRAfFOjUqtHBAd5jDoArdI+cHBs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-448-KMWSaiwANveXzM9y6wWD-g-1; Tue, 23 May 2023 08:50:09 -0400 X-MC-Unique: KMWSaiwANveXzM9y6wWD-g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 498DE811762; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3336B2029F6E; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F187819465A8; Tue, 23 May 2023 12:50:06 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 865D319465A0 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6462A9D7B; Tue, 23 May 2023 12:50:05 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C9E69D73 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E4818039B7 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-zQERWOB1MIils6lzsZrnAQ-1; Tue, 23 May 2023 08:50:03 -0400 X-MC-Unique: zQERWOB1MIils6lzsZrnAQ-1 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f60e730c4bso3269575e9.1 for ; Tue, 23 May 2023 05:50:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=Q+vmxF1DAZQxcYTLt2l9TY4/LNVbgg6sSkTr8KxCDWTwcHNhSNKPFZ41GTX6gk9V6R 4PwBNX1f8rLm17Tzx2FOu+u51ObJf9rOkVU2IeoN7LvlieW34+ymwYKoa9kS+P3k4jst vLPzOKFtdZdtz7w8iAi6QShJGniwALoWmXQweAqNbj2899yVh1Ur+6yN5S2mwI11j16S ymS588QqEfF995EMpn7GTgLMg5bPPXvehdZKnoet/A+L7vmP8CZDtzvnPFBsvErRsut0 RIzFepnE6UxuC6H0/wakuInApHsX+OFcgDBzXbMj0ZUJ2Kl7qc6uLB1lxVCuWYs0idaQ CVgw== X-Gm-Message-State: AC+VfDzTNQ2weR9q2G1zQsTcI5YclDwT9EhpCFL1q8/6cI9NQYLEM/Ed 4gQT/R2OW6Xw1VMvY6IOwynPUQ== X-Received: by 2002:a1c:f614:0:b0:3f5:d0b8:4a53 with SMTP id w20-20020a1cf614000000b003f5d0b84a53mr10552864wmc.34.1684846201991; Tue, 23 May 2023 05:50:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m7-20020a5d56c7000000b0030630120e56sm10943460wrw.57.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:01 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2BF7D1FFBD; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 02/10] trace-events: remove the remaining vcpu trace events Date: Tue, 23 May 2023 13:49:52 +0100 Message-Id: <20230523125000.3674739-3-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org While these are all in helper functions being designated vcpu events complicates the removal of the dynamic vcpu state code. TCG plugins allow you to instrument vcpu_[init|exit|idle]. We rename cpu_reset and make it a normal trace point. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-3-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-3-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 4 ++-- trace/control-target.c | 1 - trace/control.c | 2 -- hw/core/trace-events | 3 +++ trace-events | 31 ------------------------------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..951477a7fd 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -32,7 +32,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace/trace-root.h" +#include "trace.h" #include "qemu/plugin.h" CPUState *cpu_by_arch_id(int64_t id) @@ -113,7 +113,7 @@ void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); - trace_guest_cpu_reset(cpu); + trace_cpu_reset(cpu->cpu_index); } static void cpu_common_reset_hold(Object *obj) diff --git a/trace/control-target.c b/trace/control-target.c index c0c1e2310a..a10752924b 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -144,5 +144,4 @@ void trace_init_vcpu(CPUState *vcpu) } } } - trace_guest_cpu_enter(vcpu); } diff --git a/trace/control.c b/trace/control.c index 6c77cc6318..d24af91004 100644 --- a/trace/control.c +++ b/trace/control.c @@ -277,8 +277,6 @@ void trace_fini_vcpu(CPUState *vcpu) TraceEventIter iter; TraceEvent *ev; - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev = trace_event_iter_next(&iter)) != NULL) { if (trace_event_is_vcpu(ev) && diff --git a/hw/core/trace-events b/hw/core/trace-events index 56da55bd71..2cf085ac66 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -29,3 +29,6 @@ clock_set(const char *clk, uint64_t old, uint64_t new) "'%s', %"PRIu64"Hz->%"PRI clock_propagate(const char *clk) "'%s'" clock_update(const char *clk, const char *src, uint64_t hz, int cb) "'%s', src='%s', val=%"PRIu64"Hz cb=%d" clock_set_mul_div(const char *clk, uint32_t oldmul, uint32_t mul, uint32_t olddiv, uint32_t div) "'%s', mul: %u -> %u, div: %u -> %u" + +# cpu-common.c +cpu_reset(int cpu_index) "%d" diff --git a/trace-events b/trace-events index 691c3533e4..dd318ed1af 100644 --- a/trace-events +++ b/trace-events @@ -54,34 +54,3 @@ qmp_job_resume(void *job) "job %p" qmp_job_complete(void *job) "job %p" qmp_job_finalize(void *job) "job %p" qmp_job_dismiss(void *job) "job %p" - - -### Guest events, keep at bottom - - -## vCPU - -# trace/control-target.c - -# Hot-plug a new virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_enter(void) - -# trace/control.c - -# Hot-unplug a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_exit(void) - -# hw/core/cpu.c - -# Reset the state of a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_reset(void) - From patchwork Tue May 23 12:49:53 2023 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: 684903 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697573wrt; Tue, 23 May 2023 05:50:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47cqxXVTq/2YlklwrRoI1BjnqtcYPN3zKBHkCwnQERL8TyPmjxpH/dMZj9S2PobcWREeVI X-Received: by 2002:a05:620a:c0e:b0:75b:23a1:417 with SMTP id l14-20020a05620a0c0e00b0075b23a10417mr3647699qki.45.1684846216890; Tue, 23 May 2023 05:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846216; cv=none; d=google.com; s=arc-20160816; b=0d6YN27V1NdCW9J1yV5bC7/1/HCVKoVGmyHTo+JgdKY96kenwyF0D/AhzBXTVQ28V+ 2yu7aAEWny8jL6oBknbnE11uJ+XQgS/+98Hl03iFgt3cIMztpKsejS7Hic942eJqO9+9 9CZTJhd1V6pKrWR6ZuVAQFIbUQuCd3eIlg8blJiaTmmBDx2d4XOZn/L6OZ9VCd9/hCQ/ hp8cMQCoTznTIx+4/v/HW7N6OsVGs6x5quyCTf948Xdq9PVE1Xfh3fkPVlrA5AvBk5Sk mftj31S1PpYcvCcKEzbnkuAzCjA6dnXofhDE1pArUkV7k9XQ9+vUez6tuQNbtWgvuclP 7IYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=dDTRNbHHfOKuSvK6eM9DhU8dymn4KvaOj+XIlp9B2OaoFrheaifX2IziTmCVuFsQhu on415cunSnNiBAfqi9Lw7vVLf/Y0N5wpR10daMsaF1cwHsq/BeqIbehUycFpycXN0UHQ igsamllZXzRMRdJBja1TqCipwkmexWRZCk3bxuvkiJRoEW1oGOCBvNV4GEiO9t6FTxEH kIbHKCfNZwgaCtyRKC17tPzvHrI9+WrzpCdlnE4yu3TF2MriuuQ8V7d464T6sfRwEkUm oRYFojl2rv4wAQfuN6wrL/tXrgGW6KYcc/Vox64A+mFlnP5nMHI0CcUHoHpnqy5er/M5 DUUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PU6Yn4Qj; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id kl20-20020a056214519400b005ef5fcb69fesi4910897qvb.245.2023.05.23.05.50.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PU6Yn4Qj; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846216; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=PU6Yn4QjRQddkHztMwe8wkfYsX4W0kqCDNYIAjV9xqiZ5fFUGHNCTeHiI2Wtlwxh/R5knH vRbjQuCLelB6RtplVylR6fDwTA2ChYyiwIwcX150hMZQgHtVAf9AWVGRXkDBPFLJshRNge PVWtqvmlG3xrkYs30x8keeLoypy11NQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-6-oWq2ZEKUP2G-93d8P_Qj3A-1; Tue, 23 May 2023 08:50:15 -0400 X-MC-Unique: oWq2ZEKUP2G-93d8P_Qj3A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99F0A280AA2B; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85BB0140EBB8; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3C0BB19459F1; Tue, 23 May 2023 12:50:07 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BC5CC19465A0 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AFF6A140E95D; Tue, 23 May 2023 12:50:05 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7F50140E961 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C16F800159 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-rBkdjLcYPwqiOoAe0tRqjw-1; Tue, 23 May 2023 08:50:03 -0400 X-MC-Unique: rBkdjLcYPwqiOoAe0tRqjw-1 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3093d10442aso4721046f8f.1 for ; Tue, 23 May 2023 05:50:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=NWcJZenKEW/GBCCXG60oQL09xVJrWYgsgNfs9RItfqDY844GrEcfszeQWuuR298GMp yG0fZiumaZB3fvhYQ7PsxJk6TmjzQS9RdjpCWNV6/9wCEJUOB664XikbUB7oiNtx9cSZ JnoJfQIejcc9Z/TGHWdvyFMF1kSXhcSmTNBZ4uqNak+wMFk37hSxaaL5QJPvrFfyCg/w Nl2ulyj5c3+PwvNrGlv0YtEFa8vMP9/mVPvWwkwOWVGLsXzqi/JLQObXWgPjWZI9U8af 4qpS+gnm4LibNFui6N/+u4QmUr2xItNaeQKmSerQQuzB1jPqz3iwww1/ukZ3i4dFDkXH pifQ== X-Gm-Message-State: AC+VfDzHEha2Ly3LH4tPCt2WSYliXQb6xOFxnewx0bLN6lceqH4kj7YF Hp+kPx8MFxGb7D5OwdeuC6nyLw== X-Received: by 2002:a5d:4fcc:0:b0:306:31e0:958 with SMTP id h12-20020a5d4fcc000000b0030631e00958mr9243256wrw.15.1684846202750; Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o10-20020a5d670a000000b0030903371ef9sm11095816wru.22.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4D5901FFBE; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Tue, 23 May 2023 13:49:53 +0100 Message-Id: <20230523125000.3674739-4-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Message-Id: <20230420150009.1675181-4-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-4-alex.bennee@linaro.org> --- trace/control-internal.h | 4 ++-- trace/event-internal.h | 2 -- trace/control.c | 10 ---------- scripts/tracetool/format/c.py | 6 ------ scripts/tracetool/format/h.py | 11 +---------- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8b2b50a7cf..0178121720 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id != TRACE_VCPU_EVENT_NONE; + return false; } static inline const char * trace_event_get_name(TraceEvent *ev) diff --git a/trace/event-internal.h b/trace/event-internal.h index f63500b37e..0c24e01b52 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -19,7 +19,6 @@ /** * TraceEvent: * @id: Unique event identifier. - * @vcpu_id: Unique per-vCPU event identifier. * @name: Event name. * @sstate: Static tracing state. * @dstate: Dynamic tracing state @@ -33,7 +32,6 @@ */ typedef struct TraceEvent { uint32_t id; - uint32_t vcpu_id; const char * name; const bool sstate; uint16_t *dstate; diff --git a/trace/control.c b/trace/control.c index d24af91004..5dfb609954 100644 --- a/trace/control.c +++ b/trace/control.c @@ -68,16 +68,6 @@ void trace_event_register_group(TraceEvent **events) size_t i; for (i = 0; events[i] != NULL; i++) { events[i]->id = next_id++; - if (events[i]->vcpu_id == TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id = next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1); event_groups[nevent_groups].events = events; diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index c390c1844a..69edf0d588 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -32,19 +32,13 @@ def generate(events, backend, group): out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) for e in events: - if "vcpu" in e.properties: - vcpu_id = 0 - else: - vcpu_id = "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s = {', ' .id = 0,', - ' .vcpu_id = %(vcpu_id)s,', ' .name = \"%(name)s\",', ' .sstate = %(sstate)s,', ' .dstate = &%(dstate)s ', '};', event = e.api(e.QEMU_EVENT), - vcpu_id = vcpu_id, name = e.name, sstate = "TRACE_%s_ENABLED" % e.name.upper(), dstate = e.api(e.QEMU_DSTATE)) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..285d7b03a9 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -74,16 +74,7 @@ def generate(events, backend, group): out('}') - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu = next(iter(e.args))[1] - cond = "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=trace_cpu, - id=e.name.upper()) - else: - cond = "true" + cond = "true" out('', 'static inline void %(api)s(%(args)s)', From patchwork Tue May 23 12:49:54 2023 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: 684910 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697721wrt; Tue, 23 May 2023 05:50:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ED5a/Mg8a8ktEgf8wSfRYBfArntn31xRgELDGvxmchA9QEDiI2wcxenJWoX8sbwWslTi6 X-Received: by 2002:a05:6214:509b:b0:623:9ac1:a4c4 with SMTP id kk27-20020a056214509b00b006239ac1a4c4mr22517757qvb.42.1684846230077; Tue, 23 May 2023 05:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846230; cv=none; d=google.com; s=arc-20160816; b=05eKM3uMtds34SY5gR+Xv7q1kL7IYpqUAIi5d3sZH80earWtFNzlAvN/ZUiGP9dRD6 ELd6PBySZED1lo2/00tlEDXsBhPE9RUBBKSDXw9OdPPQ6Os6SG+M6sKuSyk+Nx1tUMGD o5MEhNHhpk+Q7rEvF44ldFM3KxJ/UwzE52lyegM+xGu/WFSWi2ofSRqahcaJHOm5dxQf wUwS6Nl/F5Bb5433Yx4HBeJQmhTiBfZS186NH12FzfpbEqt2CtE/tM+P+EhIu1sRb3x3 msQwp2SiRIxuDv9Q96pIgnDaIDAgQoBw1oaeyzd4rghvBmUIj6Mge8wvm641/lpGm6kl L7wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=gEVG4gw0tUu+VSA/zyPcYID7+arsQuShkfKWTx/NUSlrsCZq5kP9YbIJH0fX/gVH3S W40ylvfABShmrulLu79m3NfHoTnC5Km0xrR+NdIgJ0lNH9IcCCmEyPm5mk5FpvP824wX JEMlf4xXoNZh6W17OfnOFfMgczAV0iCRw1cXkq3aiGOrUylLqwo7ykYUFRXfF6h3LAqQ j8f9E/851vGBrtCpcj0qIqe/jNT/JyxCg25WOqsd+EI0oxJe25LXrAZxdqjCSY07bORm 2m2w9kOmH4oknYIean96HqFTQlknrPmuuCUpmlUrM/3OYhTda4HKHTgTbtb1OeiJ8+T8 yszw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ddk9YIjS; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id e6-20020a0562140d8600b005f7d2dac697si5062937qve.278.2023.05.23.05.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ddk9YIjS; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846229; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=ddk9YIjS+rI1wmkA0cglk6ONOLYqGlJFbcapV/ToxydITsqUVbG35Xoeq8OIN0UMx6P9Y2 DYPkLDYB+spdyxVzs7sg5qbyHtSLZ0ecV74XxE3G0W/1nj9bChGc3DaqpWCwJOJ5lH7rqS ZVmuWPbT5EF3VDyNafoykSYtEEANe2c= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-97-5i3__enFNdGA7LQyipo2Qw-1; Tue, 23 May 2023 08:50:27 -0400 X-MC-Unique: 5i3__enFNdGA7LQyipo2Qw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D38B3847092; Tue, 23 May 2023 12:50:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55D7640D1CF; Tue, 23 May 2023 12:50:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 96CF31946A44; Tue, 23 May 2023 12:50:18 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9BD6E19465BA for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7BDA040CFD46; Tue, 23 May 2023 12:50:08 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 749FF40CFD45 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 58E9685A5B5 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-1HtIdUq4Mly0ZdlTJEwA6w-1; Tue, 23 May 2023 08:50:04 -0400 X-MC-Unique: 1HtIdUq4Mly0ZdlTJEwA6w-1 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-3f6094cb2d2so10376575e9.2 for ; Tue, 23 May 2023 05:50:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846203; x=1687438203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=UYFSQ6b8M4tGnYjg5mIkxz7tIW+spuTXOlWzJ47LfsBJ1OfQ3Rgna+hGMWwvdaQMoA xcbmKmMq2323PpMqr9j+wzUDK6MlYtTqET7DxO5mhtiYmOSUwiSS0WqP81ZaYsDZrXZx xZy8JjFhDkJG0GUtMfpxewmZQ/7fQcpAOLDKCm6EoR9qsdvy/n7SpbKKUU59KpgHyLI/ WyUCyw30nJI4pQRhoeERh2dUlhHUhZmi8oyoGfcqL1IB0DL0scGPrpWv43Uejig/U4EX oNiDWrIwtXa8LnUWEQIzgVznzfImUh/XLQYvrJsFX2HZ+6Sagp1ICQ579PASr5Oj8bNG 7ImA== X-Gm-Message-State: AC+VfDyikXjuESjGzuLXawEdU1T+yQGygpNN/VLObdRymShcW1LF01VC ymXfAS0sPvUI+W3jEGbdm+o+zA== X-Received: by 2002:a5d:62d0:0:b0:309:51c5:3bf6 with SMTP id o16-20020a5d62d0000000b0030951c53bf6mr10999718wrv.23.1684846203460; Tue, 23 May 2023 05:50:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q3-20020adff783000000b002e61e002943sm10960332wrp.116.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 657EA1FFBF; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 04/10] scripts/qapi: document the tool that generated the file Date: Tue, 23 May 2023 13:49:54 +0100 Message-Id: <20230523125000.3674739-5-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-5-alex.bennee@linaro.org> --- v4 - expand out os.path.basename(sys.argv[0]) --- scripts/qapi/gen.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..2ea27ef31c 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -13,6 +13,7 @@ from contextlib import contextmanager import os +import sys import re from typing import ( Dict, @@ -162,7 +163,7 @@ def __init__(self, fname: str, blurb: str, pydoc: str): def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by %(tool)s DO NOT MODIFY */ /* %(blurb)s @@ -174,6 +175,7 @@ def _top(self) -> str: */ ''', + tool=str(os.path.basename(sys.argv[0])), blurb=self._blurb, copyright=self._copyright) def _bottom(self) -> str: @@ -195,7 +197,9 @@ def _bottom(self) -> str: class QAPIGenTrace(QAPIGen): def _top(self) -> str: - return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n' + return super()._top() + ( + '# AUTOMATICALLY GENERATED by ' + f"{os.path.basename(sys.argv[0])}, DO NOT MODIFY\n\n" ) @contextmanager From patchwork Tue May 23 12:49:55 2023 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: 684905 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697610wrt; Tue, 23 May 2023 05:50:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mp57omv/iCg/8vvODtsnniyEa71T9R4we61XTBXk8z00vuna02HwBpkRMvlsWFnzVwzSk X-Received: by 2002:a05:620a:388f:b0:75b:23a1:8342 with SMTP id qp15-20020a05620a388f00b0075b23a18342mr3676268qkn.61.1684846220013; Tue, 23 May 2023 05:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846219; cv=none; d=google.com; s=arc-20160816; b=KqlaPAlyMIyN4zX+v3KOf57E8lsck0c9o7DOsSoM/OKO4vC56dLwC+bnBxbytipBf1 3FzhWCN5bVeCew0r4e2aXQoldnNEmUVsOnAGjsRNxUHzcGah5UvyO0pkuR44d4+jBnBH gKU8Al9Szk5TxS5XAiDkeIJ7ioXnLC+a9GPBq93SEs2saAIMvueWsX0HNVSfiRXcW3vn /HwpuTfhKwr478UY9gYtaKc29Hkjq+AHGZ2cRpcAt7M35qy/il0KO/P3Vy41+nBVebWI 4PG3+Ut78jpuqoGVkHvaPm340wSiRR04mvWqkjyQ/am7MQuztQFKUWuu2y34VGZneVUC ta4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=oAAyam9/uchq55cP4vt5M7WByydYNut4EFZ5i9emVFZZ1pfSXX84lV5YWx0cO0M+3y u53xhbG3YLWwJlY8V5f3ehwpywwhAoe3nr6X9YQUhxYo8O2FnrqaWuotafayuSq2rQ9k qmt0YPxg1dJn+LIs8RyyHzyDDcHC/u5GvQA5rJOnlagjo7ntd4zrWl91hR0l0pjKgLxV O49ywcH1pjnFOk31Sz1+BxQClkTgQnMuRP7BIDaE4/OefDBJpb1D28H2Ze8CvGGIXEy3 6U9AhlLrNV4lmQGTi4t+hv56UtEcmm4PAUXj8rG+P4QDNLlO9CN63TUThGBmMGKsEUyA ST/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HNzzzVP2; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id j1-20020ae9c201000000b0075929859d03si4705812qkg.785.2023.05.23.05.50.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HNzzzVP2; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846219; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=HNzzzVP2OBwyTylDaGSP/Q4FCLhmbrtSi+JdlBJmdUbdA1ddR505lSrcaE+Y4V2ct7UdYq KBViyZdTFyvkB+nNWyGIQ3yEaj/jjYOTWXeuG2S96Gf3q7BfY6Keib3vATYtfV6cYO68vK sPyW0S0ZBNsCiMpeWRDyIMWyyqwP7WQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641--N2FFE4YNSet6DCrT7lnxA-1; Tue, 23 May 2023 08:50:15 -0400 X-MC-Unique: -N2FFE4YNSet6DCrT7lnxA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D7E39803C82; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEADD40CFD4A; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9DD841946A41; Tue, 23 May 2023 12:50:12 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A5C0419465A8 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 94ECC2166B25; Tue, 23 May 2023 12:50:06 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CB3D2166B27 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 70AB085828C for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589--QLqBAE_MTOncSuelbqQAg-2; Tue, 23 May 2023 08:50:04 -0400 X-MC-Unique: -QLqBAE_MTOncSuelbqQAg-2 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-3f60444238cso23905445e9.3 for ; Tue, 23 May 2023 05:50:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846203; x=1687438203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=VBk+AN2x9AlDRNLfg3JXEpArnK4dwtholVl73ByODlFg5CMTAVEhlCuDs42qQz+6VP PtXVhuqHaISPBRw8NNILThTSpgvSIzeGeEpkWGsS4QJNsY/GREDzZhiviEaT8mfUDPXB ZFNwcKVw+Uu2u0kJ1kDau8fIbOpP6tmh4jGfdVB+hTm753RqkJGChba2ajmoED1eMSji HmrSOKBZkAMeyzTClsMjBR1LAkDo1V6Zk7IUP1xiRDGVx86GK/DwaNcInLhSnNeSjStN AvA8HGWdbYNBgy6HHpCofaR0+3LbkpuWNqQM1PVYpXwJwh2Y2yWYVY9vXavAIgc+OBUw Pezg== X-Gm-Message-State: AC+VfDwRN19wbXlMGdi3s/GgEVSD5JImtgnXmFzRkEdLI3l7gn+PDo+E yfj9thzFgieAXCJvQJlBcLsF2g== X-Received: by 2002:a5d:45c4:0:b0:309:3ddc:1c8d with SMTP id b4-20020a5d45c4000000b003093ddc1c8dmr8660172wrs.70.1684846203637; Tue, 23 May 2023 05:50:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z12-20020a5d640c000000b00307c8d6b4a0sm10995580wru.26.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7EFB21FFC0; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 05/10] qapi: make the vcpu parameters deprecated for 8.1 Date: Tue, 23 May 2023 13:49:55 +0100 Message-Id: <20230523125000.3674739-6-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org I don't think I can remove the parameters directly but certainly mark them as deprecated. Message-Id: <20230420150009.1675181-6-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-6-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-6-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé --- v4 - used @deprecated in json - added note to deprecated.rst --- docs/about/deprecated.rst | 9 +++++++++ qapi/trace.json | 38 ++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e934e0a13a..e44cde057f 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -254,6 +254,15 @@ it. Since all recent x86 hardware from the past >10 years is capable of the QEMU API (QAPI) events ---------------------- +``vcpu`` trace events (since 8.1) +''''''''''''''''''''''''''''''''' + +The ability to instrument QEMU helper functions with vcpu aware trace +points was removed in 7.0. However the QAPI still exposed the vcpu +parameter. This argument has now been deprecated and the remaining +used trace points converted to plain trace points selected just by +name. + ``MEM_UNPLUG_ERROR`` (since 6.2) '''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/qapi/trace.json b/qapi/trace.json index 6bf0af0946..aac58e875b 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -37,13 +37,14 @@ # # @vcpu: Whether this is a per-vCPU event (since 2.7). # -# An event is per-vCPU if it has the "vcpu" property in the -# "trace-events" files. +# Features: +# @deprecated: Member @vcpu is deprecated, and always false. # # Since: 2.2 ## { 'struct': 'TraceEventInfo', - 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} } + 'data': {'name': 'str', 'state': 'TraceEventState', + 'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } } ## # @trace-event-get-state: @@ -52,19 +53,17 @@ # # @name: Event name pattern (case-sensitive glob). # -# @vcpu: The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (since 2.7). +# +# Features: +# @deprecated: Member @vcpu is deprecated, and always false. # # Returns: a list of @TraceEventInfo for the matching events # # An event is returned if: # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. -# -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, returning their state on the specified vCPU. Special case: -# if @name is an exact match, @vcpu is given and the event does not -# have the "vcpu" property, an error is returned. +# - its name matches the @name pattern +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -75,7 +74,8 @@ # <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] } ## { 'command': 'trace-event-get-state', - 'data': {'name': 'str', '*vcpu': 'int'}, + 'data': {'name': 'str', + '*vcpu': {'type': 'int', 'features': ['deprecated'] } }, 'returns': ['TraceEventInfo'] } ## @@ -91,15 +91,13 @@ # # @vcpu: The vCPU to act upon (all by default; since 2.7). # -# An event's state is modified if: +# Features: +# @deprecated: Member @vcpu is deprecated, and always false. # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# An event's state is modified if: # -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, setting their state on the specified vCPU. Special case: if -# @name is an exact match, @vcpu is given and the event does not have -# the "vcpu" property, an error is returned. +# - its name matches the @name pattern +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -111,4 +109,4 @@ ## { 'command': 'trace-event-set-state', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', - '*vcpu': 'int'} } + '*vcpu': {'type': 'int', 'features': ['deprecated'] } } } From patchwork Tue May 23 12:49:56 2023 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: 684913 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1698032wrt; Tue, 23 May 2023 05:51:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4qW6HgtF5plN8OUVit3vAhGyl+8ok76Bx+psKc+yLyqcKAjswDXaaE5wSrL4qT2kTTqxTW X-Received: by 2002:a05:6214:e69:b0:623:a303:7083 with SMTP id jz9-20020a0562140e6900b00623a3037083mr17459880qvb.19.1684846266895; Tue, 23 May 2023 05:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846266; cv=none; d=google.com; s=arc-20160816; b=fVcQWXpU20M+I83javVIGC06qVWSomt7cb6cems3EHE7mPxb/3NDewHxu1aogubjsF KRYaL09mHXHK5VXwLwD6q5TaQWL2DR88E53W4ws4M2IrR+fBrxf6p2LC47KybsE1yFlP wF0AR56XRlkUEsVl+D3+FlKAR/9+MveOP/4kZmcRrf9kH6jHFRiVVcFOTyOYtufy4r6+ kea/KggAP9iL+Fc16LkcUx/fS60+2dVMZE8vu4jU+MK6ZVYGz4u9/qZVKVA39CnMuk0X JTGXmR3IREPF4cOQWC/1R2e5rkMPTMJ5VNuTX8FYVMTfh5faY1IK9L/c5M8ISeON/3t6 dr/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=hfEBcaH7nHVbR9/kVEtwz57fQNKQfXGJzuARtAmZ4qk=; b=FTqzPbkEpGZeQ5Q6AWPUB1uG78S8mWIGDvAxcSBIpQdASAGGDeYV8r1R6CSSmdWom2 JVFo2wwKrwcjD0iEQL8cHzDV6KEhCKcE6X5sSH1lZkNfkIYp/ENrApEtnHaDBKj00lut amGstLY+naHBCqO4fuF4aXFcvYylXTzPtNE67laRMYnE7kvPUK8CITX4PFxGFUwy6O7Y w5oMoPB00UGxvtJ0keGhMXRe8GnoigKAt8/Ah4YWLBz3OhhpnxMoHsOHtg1izbwGzwks 91wyzod3nqdt+z8Az+yJyqG0tpBHkhEPbXmnU4oFYiQ/vZU5gkv8Swda0uuQ0451fh6R CaSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XQMsmOp3; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id eq6-20020ad45966000000b0061b6d63b1a3si4840913qvb.408.2023.05.23.05.51.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XQMsmOp3; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846266; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hfEBcaH7nHVbR9/kVEtwz57fQNKQfXGJzuARtAmZ4qk=; b=XQMsmOp3xXJdT8GO516vj0p9xINxoe9KYONReRzG+pDfiICyGxga58sWckfNhPd/lKT6PQ tHIu8LUbdx5Mer1koDu+tpSBJA5XBW0RSoieurNLAsJOI+ukZHps+cwuEvOb1Aqc4dZ2zt QO/aoHgIb02vnmNmSmwp3SiLHZQkTos= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-wiXObG9bNpyOpNQNG03asA-1; Tue, 23 May 2023 08:50:33 -0400 X-MC-Unique: wiXObG9bNpyOpNQNG03asA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CAD1C811E7C; Tue, 23 May 2023 12:50:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1802202696C; Tue, 23 May 2023 12:50:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B0A2E19451D7; Tue, 23 May 2023 12:50:18 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 40D1B19465BA for ; Tue, 23 May 2023 12:50:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 13D5740CFD46; Tue, 23 May 2023 12:50:09 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A12340CFD45 for ; Tue, 23 May 2023 12:50:09 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DE9EF101B041 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558--MGwCFv4NaS1hAqYM-q-GQ-1; Tue, 23 May 2023 08:50:06 -0400 X-MC-Unique: -MGwCFv4NaS1hAqYM-q-GQ-1 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-30a4ebbda56so3294999f8f.1 for ; Tue, 23 May 2023 05:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846205; x=1687438205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hfEBcaH7nHVbR9/kVEtwz57fQNKQfXGJzuARtAmZ4qk=; b=b8E9zVpeG/pv8C27hSbcI4OkMD+7PQ2oko4k0RXcZ5bbYNh9uPfEd6Odalx/kJ+zNB D5K/XX8ZUxixenYL1keSvBxIk1PzwJZL4Rn77F1dNOrvEMRaYmSx0zog+WZEDa9rrBZm bQTh0MbFLcOEp+m1XXhkxRP3hcYxk65hwp1ecPSlavTXolol08vNgohHtoomcUrQ9Jll k5aBtQHX2j1T2OSNefGmslKFlubpjpViDmtrAQ3s+K22ZKzcHBzMa/fl3LdSu3/cukB7 OhqVxoYdulVGo7tvu71+Qgy0dL6RTbXB49eFY+rKHfhNQGhQH66Wb+fJATrA5LllAGAA AYKw== X-Gm-Message-State: AC+VfDxhvQqjXJAkTsR3vRHmVuAHcgQjRLsra5jolTutyJxH9jJLoEAS SNRpmTqM2J9DgVot9lcWHRsZuA== X-Received: by 2002:adf:df81:0:b0:306:2f91:302e with SMTP id z1-20020adfdf81000000b003062f91302emr12455082wrl.21.1684846204835; Tue, 23 May 2023 05:50:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y11-20020adfd08b000000b002fae7408544sm8875672wrh.108.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AC99B1FFC1; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 06/10] trace: remove code that depends on setting vcpu Date: Tue, 23 May 2023 13:49:56 +0100 Message-Id: <20230523125000.3674739-7-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Now we no longer have any events that are for vcpus we can start excising the code from the trace control. As the vcpu parameter is encoded as part of QMP we just stub out the has_vcpu/vcpu parameters rather than alter the API. Message-Id: <20230420150009.1675181-7-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-7-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-7-alex.bennee@linaro.org> --- trace/control-internal.h | 10 ---- trace/control-vcpu.h | 16 ------ trace/control.h | 48 ----------------- hw/core/cpu-common.c | 2 - stubs/trace-control.c | 13 ----- trace/control-target.c | 108 ++++----------------------------------- trace/control.c | 16 ------ trace/qmp.c | 74 +++------------------------ trace/trace-hmp-cmds.c | 17 +----- 9 files changed, 19 insertions(+), 285 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 0178121720..8d818d359b 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -25,16 +25,6 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) return ev->id; } -static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) -{ - return 0; -} - -static inline bool trace_event_is_vcpu(TraceEvent *ev) -{ - return false; -} - static inline const char * trace_event_get_name(TraceEvent *ev) { assert(ev != NULL); diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h index 0f98ebe7b5..800fc5a219 100644 --- a/trace/control-vcpu.h +++ b/trace/control-vcpu.h @@ -30,13 +30,6 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ vcpu, _ ## id ## _EVENT.vcpu_id)) -/** - * trace_event_get_vcpu_state_dynamic: - * - * Get the dynamic tracing state of an event for the given vCPU. - */ -static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent *ev); - #include "control-internal.h" static inline bool @@ -51,13 +44,4 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, } } -static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev) -{ - uint32_t vcpu_id; - assert(trace_event_is_vcpu(ev)); - vcpu_id = trace_event_get_vcpu_id(ev); - return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id); -} - #endif diff --git a/trace/control.h b/trace/control.h index 23b8393b29..dfd209edd8 100644 --- a/trace/control.h +++ b/trace/control.h @@ -89,23 +89,6 @@ static bool trace_event_is_pattern(const char *str); */ static uint32_t trace_event_get_id(TraceEvent *ev); -/** - * trace_event_get_vcpu_id: - * - * Get the per-vCPU identifier of an event. - * - * Special value #TRACE_VCPU_EVENT_NONE means the event is not vCPU-specific - * (does not have the "vcpu" property). - */ -static uint32_t trace_event_get_vcpu_id(TraceEvent *ev); - -/** - * trace_event_is_vcpu: - * - * Whether this is a per-vCPU event. - */ -static bool trace_event_is_vcpu(TraceEvent *ev); - /** * trace_event_get_name: * @@ -172,21 +155,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *ev); */ void trace_event_set_state_dynamic(TraceEvent *ev, bool state); -/** - * trace_event_set_vcpu_state_dynamic: - * - * Set the dynamic tracing state of an event for the given vCPU. - * - * Pre-condition: trace_event_get_vcpu_state_static(ev) == true - * - * Note: Changes for execution-time events with the 'tcg' property will not be - * propagated until the next TB is executed (iff executing in TCG mode). - */ -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state); - - - /** * trace_init_backends: * @@ -205,22 +173,6 @@ bool trace_init_backends(void); */ void trace_init_file(void); -/** - * trace_init_vcpu: - * @vcpu: Added vCPU. - * - * Set initial dynamic event state for a hot-plugged vCPU. - */ -void trace_init_vcpu(CPUState *vcpu); - -/** - * trace_fini_vcpu: - * @vcpu: Removed vCPU. - * - * Disable dynamic event state for a hot-unplugged vCPU. - */ -void trace_fini_vcpu(CPUState *vcpu); - /** * trace_list_events: * @f: Where to send output. diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 951477a7fd..f4e51c8a1b 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -211,7 +211,6 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) } /* NOTE: latest generic point where the cpu is fully realized */ - trace_init_vcpu(cpu); } static void cpu_common_unrealizefn(DeviceState *dev) @@ -219,7 +218,6 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu = CPU(dev); /* NOTE: latest generic point before the cpu is fully unrealized */ - trace_fini_vcpu(cpu); cpu_exec_unrealizefn(cpu); } diff --git a/stubs/trace-control.c b/stubs/trace-control.c index 7f856e5c24..b428f34c87 100644 --- a/stubs/trace-control.c +++ b/stubs/trace-control.c @@ -36,16 +36,3 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool state) } } } - -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state) -{ - /* should never be called on non-target binaries */ - abort(); -} - -void trace_init_vcpu(CPUState *vcpu) -{ - /* should never be called on non-target binaries */ - abort(); -} diff --git a/trace/control-target.c b/trace/control-target.c index a10752924b..97f21e476d 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -36,112 +36,22 @@ void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { - CPUState *vcpu; assert(trace_event_get_state_static(ev)); - if (trace_event_is_vcpu(ev) && likely(first_cpu != NULL)) { - CPU_FOREACH(vcpu) { - trace_event_set_vcpu_state_dynamic(vcpu, ev, state); - } - } else { - /* - * Without the "vcpu" property, dstate can only be 1 or 0. With it, we - * haven't instantiated any vCPU yet, so we will set a global state - * instead, and trace_init_vcpu will reconcile it afterwards. - */ - bool state_pre = *ev->dstate; - if (state_pre != state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate = 1; - } else { - trace_events_enabled_count--; - *ev->dstate = 0; - } - } - } -} -static void trace_event_synchronize_vcpu_state_dynamic( - CPUState *vcpu, run_on_cpu_data ignored) -{ - bitmap_copy(vcpu->trace_dstate, vcpu->trace_dstate_delayed, - CPU_TRACE_DSTATE_MAX_EVENTS); - tcg_flush_jmp_cache(vcpu); -} - -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state) -{ - uint32_t vcpu_id; - bool state_pre; - assert(trace_event_get_state_static(ev)); - assert(trace_event_is_vcpu(ev)); - vcpu_id = trace_event_get_vcpu_id(ev); - state_pre = test_bit(vcpu_id, vcpu->trace_dstate); + /* + * There is no longer a "vcpu" property, dstate can only be 1 or + * 0. With it, we haven't instantiated any vCPU yet, so we will + * set a global state instead, and trace_init_vcpu will reconcile + * it afterwards. + */ + bool state_pre = *ev->dstate; if (state_pre != state) { if (state) { trace_events_enabled_count++; - set_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)++; + *ev->dstate = 1; } else { trace_events_enabled_count--; - clear_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)--; - } - if (vcpu->created) { - /* - * Delay changes until next TB; we want all TBs to be built from a - * single set of dstate values to ensure consistency of generated - * tracing code. - */ - async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic, - RUN_ON_CPU_NULL); - } else { - trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NULL); - } - } -} - -static bool adding_first_cpu1(void) -{ - CPUState *cpu; - size_t count = 0; - CPU_FOREACH(cpu) { - count++; - if (count > 1) { - return false; - } - } - return true; -} - -static bool adding_first_cpu(void) -{ - QEMU_LOCK_GUARD(&qemu_cpu_list_lock); - - return adding_first_cpu1(); -} - -void trace_init_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - trace_event_iter_init_all(&iter); - while ((ev = trace_event_iter_next(&iter)) != NULL) { - if (trace_event_is_vcpu(ev) && - trace_event_get_state_static(ev) && - trace_event_get_state_dynamic(ev)) { - if (adding_first_cpu()) { - /* check preconditions */ - assert(*ev->dstate == 1); - /* disable early-init state ... */ - *ev->dstate = 0; - trace_events_enabled_count--; - /* ... and properly re-enable */ - trace_event_set_vcpu_state_dynamic(vcpu, ev, true); - } else { - trace_event_set_vcpu_state_dynamic(vcpu, ev, true); - } + *ev->dstate = 0; } } } diff --git a/trace/control.c b/trace/control.c index 5dfb609954..1a48a7e266 100644 --- a/trace/control.c +++ b/trace/control.c @@ -262,22 +262,6 @@ void trace_init_file(void) #endif } -void trace_fini_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - - trace_event_iter_init_all(&iter); - while ((ev = trace_event_iter_next(&iter)) != NULL) { - if (trace_event_is_vcpu(ev) && - trace_event_get_state_static(ev) && - trace_event_get_vcpu_state_dynamic(vcpu, ev)) { - /* must disable to affect the global counter */ - trace_event_set_vcpu_state_dynamic(vcpu, ev, false); - } - } -} - bool trace_init_backends(void) { #ifdef CONFIG_TRACE_SIMPLE diff --git a/trace/qmp.c b/trace/qmp.c index 3b4f4702b4..aa760f1fc4 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -13,20 +13,7 @@ #include "control-vcpu.h" -static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp) -{ - if (has_vcpu) { - CPUState *cpu = qemu_get_cpu(vcpu); - if (cpu == NULL) { - error_setg(errp, "invalid vCPU index %u", vcpu); - } - return cpu; - } else { - return NULL; - } -} - -static bool check_events(bool has_vcpu, bool ignore_unavailable, bool is_pattern, +static bool check_events(bool ignore_unavailable, bool is_pattern, const char *name, Error **errp) { if (!is_pattern) { @@ -38,12 +25,6 @@ static bool check_events(bool has_vcpu, bool ignore_unavailable, bool is_pattern return false; } - /* error for non-vcpu event */ - if (has_vcpu && !trace_event_is_vcpu(ev)) { - error_setg(errp, "event \"%s\" is not vCPU-specific", name); - return false; - } - /* error for unavailable event */ if (!ignore_unavailable && !trace_event_get_state_static(ev)) { error_setg(errp, "event \"%s\" is disabled", name); @@ -70,22 +51,13 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err = NULL; TraceEventInfoList *events = NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern = trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu = get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return NULL; - } /* Check events */ - if (!check_events(has_vcpu, true, is_pattern, name, errp)) { + if (!check_events(true, is_pattern, name, errp)) { return NULL; } @@ -93,33 +65,17 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, trace_event_iter_init_pattern(&iter, name); while ((ev = trace_event_iter_next(&iter)) != NULL) { TraceEventInfo *value; - bool is_vcpu = trace_event_is_vcpu(ev); - if (has_vcpu && !is_vcpu) { - continue; - } value = g_new(TraceEventInfo, 1); - value->vcpu = is_vcpu; value->name = g_strdup(trace_event_get_name(ev)); if (!trace_event_get_state_static(ev)) { value->state = TRACE_EVENT_STATE_UNAVAILABLE; } else { - if (has_vcpu) { - if (is_vcpu) { - if (trace_event_get_vcpu_state_dynamic(cpu, ev)) { - value->state = TRACE_EVENT_STATE_ENABLED; - } else { - value->state = TRACE_EVENT_STATE_DISABLED; - } - } - /* else: already skipped above */ + if (trace_event_get_state_dynamic(ev)) { + value->state = TRACE_EVENT_STATE_ENABLED; } else { - if (trace_event_get_state_dynamic(ev)) { - value->state = TRACE_EVENT_STATE_ENABLED; - } else { - value->state = TRACE_EVENT_STATE_DISABLED; - } + value->state = TRACE_EVENT_STATE_DISABLED; } } QAPI_LIST_PREPEND(events, value); @@ -133,21 +89,12 @@ void qmp_trace_event_set_state(const char *name, bool enable, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err = NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern = trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu = get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return; - } /* Check events */ - if (!check_events(has_vcpu, has_ignore_unavailable && ignore_unavailable, + if (!check_events(has_ignore_unavailable && ignore_unavailable, is_pattern, name, errp)) { return; } @@ -155,14 +102,9 @@ void qmp_trace_event_set_state(const char *name, bool enable, /* Apply changes (all errors checked above) */ trace_event_iter_init_pattern(&iter, name); while ((ev = trace_event_iter_next(&iter)) != NULL) { - if (!trace_event_get_state_static(ev) || - (has_vcpu && !trace_event_is_vcpu(ev))) { + if (!trace_event_get_state_static(ev)) { continue; } - if (has_vcpu) { - trace_event_set_vcpu_state_dynamic(cpu, ev, enable); - } else { - trace_event_set_state_dynamic(ev, enable); - } + trace_event_set_state_dynamic(ev, enable); } } diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 792876c34a..1d07672cb2 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -37,16 +37,9 @@ void hmp_trace_event(Monitor *mon, const QDict *qdict) { const char *tp_name = qdict_get_str(qdict, "name"); bool new_state = qdict_get_bool(qdict, "option"); - bool has_vcpu = qdict_haskey(qdict, "vcpu"); - int vcpu = qdict_get_try_int(qdict, "vcpu", 0); Error *local_err = NULL; - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - - qmp_trace_event_set_state(tp_name, new_state, true, true, has_vcpu, vcpu, &local_err); + qmp_trace_event_set_state(tp_name, new_state, true, true, false, 0, &local_err); if (local_err) { error_report_err(local_err); } @@ -80,8 +73,6 @@ void hmp_trace_file(Monitor *mon, const QDict *qdict) void hmp_info_trace_events(Monitor *mon, const QDict *qdict) { const char *name = qdict_get_try_str(qdict, "name"); - bool has_vcpu = qdict_haskey(qdict, "vcpu"); - int vcpu = qdict_get_try_int(qdict, "vcpu", 0); TraceEventInfoList *events; TraceEventInfoList *elem; Error *local_err = NULL; @@ -89,12 +80,8 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qdict) if (name == NULL) { name = "*"; } - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - events = qmp_trace_event_get_state(name, has_vcpu, vcpu, &local_err); + events = qmp_trace_event_get_state(name, false, 0, &local_err); if (local_err) { error_report_err(local_err); return; From patchwork Tue May 23 12:49:57 2023 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: 684908 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697684wrt; Tue, 23 May 2023 05:50:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5K0TMbEvdrrzmPhEPASJSpDBgfrZ00Gg2/XKf83/sh5/caPDbZRVPX0ZYCCEO/Eq2xxmhk X-Received: by 2002:ac8:5b85:0:b0:3f5:3991:97c3 with SMTP id a5-20020ac85b85000000b003f5399197c3mr24147825qta.68.1684846226744; Tue, 23 May 2023 05:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846226; cv=none; d=google.com; s=arc-20160816; b=sQgEdjgeK9+ZWyLD62PVEcwTyN6595FlnlNsoUNLd6P27v03ie3NDaa9w7VfmR6Zj9 /jmqBiHVQbUnaPeQXKjtOP9aUIp3Z01BYkUt+wngy9SVe+cXgmF1tLqExrRLe9430aFy 4/goUZo1kB1p4phnmknIjQHcLzD1FnWltTaE5tv+i8atwUURaCyS9c/ChfaMWtUycPsH GHWASQ6a6f1cdKWuDQqw241naMTjr4wBr4L5YZfTGtWavcDPTAdwnnnKBlnCn6IG5HsQ jCWb2WhoGsPy+I8dYfv1/isXbx6P6U6Lf1nPha3DGxKlk7JY8m9CQJs4VPfIaTz7Uo6g uJ3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=FAR7ag9p7bMuSceFIZJLfo/WLA6ZgL6r6laxp9it6pqCCNB5tqSskwaTom9HgwSKT2 3SNrx01M2s/E4zq3nP4L5tdPRGDEj03s/e9Lp/c1dtA6fvX0LWTu1Dk+HpmXKBxTaieR NIe/798sNcNniRMKGbutnL5h+GuuuU7giM7TEXm2MI0BY+Gr0XKU29S8b7AGE3jdrJP3 wfsJW2uCuE2j6LLvNcZA3TUy4K9ao280LmfG+TnHvE/6hEumWdG0w2lfAwjIbWB/jyrr kjOqCaeqAgLTR8NEjHYrIHb2RjIPhUB61kacFor4lVKnd9CqyYYmKlOtstm5lGN3x1Yu PWLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eE++haUz; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id w3-20020ac87e83000000b003ef5b5c0712si5041559qtj.230.2023.05.23.05.50.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eE++haUz; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846226; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=eE++haUzUShKhtgH+znafKcXmtY6ekQpVg9+TADSQvSdsLDH9m2cHUn72YvQf5FIPYwtX/ VtKJNwDh+Jyrmt4LQJKXcPI8j+rHY7YVihWmQEjZfuYMMgFBqIJZ2lhpYYn4bY5O4BDW92 0h5CNYupAS3giCN/GLF9RTXV37EqOaA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161-uwCycPrkNx6rcdXuErMTFA-1; Tue, 23 May 2023 08:50:21 -0400 X-MC-Unique: uwCycPrkNx6rcdXuErMTFA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE39D1859171; Tue, 23 May 2023 12:50:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B86E7492B0A; Tue, 23 May 2023 12:50:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2AB8119452D3; Tue, 23 May 2023 12:50:13 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA34019465BB for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9C77940D1B60; Tue, 23 May 2023 12:50:07 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 951BC40D1B63 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B1BC85828C for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-XzYO6e5rNu65nTSr8Mr_Pg-1; Tue, 23 May 2023 08:50:05 -0400 X-MC-Unique: XzYO6e5rNu65nTSr8Mr_Pg-1 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-309d3e8777cso2544031f8f.0 for ; Tue, 23 May 2023 05:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846204; x=1687438204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=fPw6uONF4nn+KWGc8QbaFgUEMeA+Hmo0apL0Jq98eHeBmh8PqK2e4IXJziN5JEmiJH HEGDuP958SDQH9z6YOniEKRKHM+/j+CFzUaJ2WhUXczsuV6eN83git3hNkjIRQPvps1p U1Z3J2BQMz2uzKw+GYyiqfkvivMie2VeJ9r9qyVibE+yaIOrDpbZCyepYnSFLsLusQ4t uP7rMC9lmUoSgmykeQrI98KqElEMvCk94UZyfPjUtl6qlSGo0mSfnQhHgPDQhokxR3xJ d91s15lFiPioB27cPohnbp0M5RqHlGPlDrImvJB0aAtLlAhpkORJhJlyeUV/93NL1F2M zQ1Q== X-Gm-Message-State: AC+VfDwjl6PMBbgQJ+ZZjYT9lbVIQE83YUTK22JIzHM9GcEsenUm8NK5 169KrSnXyyU8U0ILmMZ/ABm+tQ== X-Received: by 2002:a5d:4585:0:b0:30a:a165:f95 with SMTP id p5-20020a5d4585000000b0030aa1650f95mr1450124wrq.19.1684846204645; Tue, 23 May 2023 05:50:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z16-20020a5d4d10000000b002f6176cc6desm11008898wrt.110.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C8D6C1FFBB; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 07/10] trace: remove control-vcpu.h Date: Tue, 23 May 2023 13:49:57 +0100 Message-Id: <20230523125000.3674739-8-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Message-Id: <20230420150009.1675181-8-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-8-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-8-alex.bennee@linaro.org> --- trace/control-vcpu.h | 47 ----------------------------------- trace/qmp.c | 2 +- scripts/tracetool/format/h.py | 5 +--- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 trace/control-vcpu.h diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h deleted file mode 100644 index 800fc5a219..0000000000 --- a/trace/control-vcpu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Interface for configuring and controlling the state of tracing events. - * - * Copyright (C) 2011-2016 Lluís Vilanova - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef TRACE__CONTROL_VCPU_H -#define TRACE__CONTROL_VCPU_H - -#include "control.h" -#include "event-internal.h" -#include "hw/core/cpu.h" - -/** - * trace_event_get_vcpu_state: - * @vcpu: Target vCPU. - * @id: Event identifier name. - * - * Get the tracing state of an event (both static and dynamic) for the given - * vCPU. - * - * If the event has the disabled property, the check will have no performance - * impact. - */ -#define trace_event_get_vcpu_state(vcpu, id) \ - ((id ##_ENABLED) && \ - trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ - vcpu, _ ## id ## _EVENT.vcpu_id)) - -#include "control-internal.h" - -static inline bool -trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, - uint32_t vcpu_id) -{ - /* it's on fast path, avoid consistency checks (asserts) */ - if (unlikely(trace_events_enabled_count)) { - return test_bit(vcpu_id, vcpu->trace_dstate); - } else { - return false; - } -} - -#endif diff --git a/trace/qmp.c b/trace/qmp.c index aa760f1fc4..3e3971c6a8 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" -#include "control-vcpu.h" +#include "control.h" static bool check_events(bool ignore_unavailable, bool is_pattern, diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 285d7b03a9..ea126b07ea 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -16,10 +16,7 @@ def generate(events, backend, group): - if group == "root": - header = "trace/control-vcpu.h" - else: - header = "trace/control.h" + header = "trace/control.h" out('/* This file is autogenerated by tracetool, do not edit. */', '', From patchwork Tue May 23 12:49:58 2023 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: 684911 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697799wrt; Tue, 23 May 2023 05:50:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VyTuKn1v9XB/fWRRHxkyTLTGDzFWu3/63piUN57tySbzW03nv5OVykUHSgoqaq5QPr4f3 X-Received: by 2002:a17:906:ee88:b0:94e:4489:f24d with SMTP id wt8-20020a170906ee8800b0094e4489f24dmr11772546ejb.61.1684846239795; Tue, 23 May 2023 05:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846239; cv=none; d=google.com; s=arc-20160816; b=1G8kWg641g7eziPuWKrIDFCoO92/xgCkb59Lgj8t3y9dKkKlYSACrfteZXPeXxGx9v xAwtVPHAmUksvzhevqWrIpye2vStdlwT60rXIXpboE5ywXYgKIpBEcvjufm+zPGN07w9 7o4A+gchocLRxP2L+RCiQP5yLbTF3lUwanXJCMi8U/DQSAz4WkCO4zQcS0go91yeOjSw Z9xgYhqy/4+b0R1VYv3jcik+7Yr6ALZJDOOGKxkJuGVzTKPm8pjGSxwjkOzyWnHgNina e0aiJoQCwxXpbceF0FpIaZU1JSMo3vJrZni4p8kmhrbRdoe5jPFTUzNaMnOJ4FaplYLW wBXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=mrI/El2lVLwGw7kyzQRUpMUoNJ/9B7EczsJYuUv0SynEQorcl+RxUqX0LUUSNTtOrx GQwpp+2hL/gkjxkQAVgm6kd1cW85nvlErmaywMuzZHf8oK2+OXRMuTqn4T6Pdf6YKBAi qaGKxmR9wHAlcaF8Ckm8feLD9sOaVe63LZfMX9uyJNeHI7gSwZStx14XIx0j6iy114Vz kXql0YAclw9/unC8AN9ADIFeK0Q4b+HWWSQhLcTOllfD+pwDjEC0QjBPfz5QA+X1pmqT KMp9UA8nKCZS1b5m9rV2JRAvUT63lDR1HFXDLvqhoT+o9u1YlDACvmwxENfEBRr3kzCt XLyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hZ+zuMk+; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id ss20-20020a170907c01400b0094f3558f7a8si272794ejc.134.2023.05.23.05.50.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hZ+zuMk+; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846238; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=hZ+zuMk+ALMzPMHeDz/M7cITTVdUZ0bt50BWyBQlDoZ5lyi8HuaXUzUZiu4a755FlUWmU+ kb+hhPNB+dKL1/x+RqmrgycWCwTlsqmnqrr9n0Ye/bTPV+i7xHpmCMetp2YjChaumzzGhE VAhyTZiDY2G4Gli/imcBCQUCScr56Qo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-534-5wUK0785PeWnRZ-zrLhaHA-1; Tue, 23 May 2023 08:50:37 -0400 X-MC-Unique: 5wUK0785PeWnRZ-zrLhaHA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0E3813C11C72; Tue, 23 May 2023 12:50:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC92FC1ED9F; Tue, 23 May 2023 12:50:34 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CB8719451E5; Tue, 23 May 2023 12:50:19 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C1CA919452C4 for ; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8F0CF40CFD48; Tue, 23 May 2023 12:50:12 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 879C340CFD47 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B9618030D6 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-nIujsWknPEebzop3VBytYg-1; Tue, 23 May 2023 08:50:05 -0400 X-MC-Unique: nIujsWknPEebzop3VBytYg-1 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-307a8386946so4852802f8f.2 for ; Tue, 23 May 2023 05:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846204; x=1687438204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=k3eU/SQlm0TeK9WhFArCMzxyW+d8gS0NLVhyjx0W8rmeE/PPT6Rdpfg1GrZVTOPrO1 KATo7QE4G9gg9aEAoeK2aRbn3rb5QBCm+lj/yzBncEH6g8d3ikcVPkR1vMIgdcn0zsTu aWsgDK2WMRaqltgmetcORsCqKAvcGvbyBrLa5trrcM84hXim190oZDXJa8cBNlvlAV0O uW9KeLj96OAGgZwa3EBkPupvQtH1FG9/U3xmsHdTKCTexJsjj8OiYLBfDcJoYRZrS/rg KsP8fXu6vrszmfQ+vFcPLqFm2mmf4IZUuLx/hFKj17SmOK0EjaMGu5wUsDJBBdV62c3n 21ng== X-Gm-Message-State: AC+VfDzXSMochIYbhJYEcR4VC+MhkR4WtSKVpAAtOsTh0mvPvlQPrGp3 y5utiTFAw3OhY6oZmj0601kkjQ== X-Received: by 2002:adf:df8e:0:b0:2ef:b19f:b24c with SMTP id z14-20020adfdf8e000000b002efb19fb24cmr9489808wrl.0.1684846204473; Tue, 23 May 2023 05:50:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b9-20020a5d4b89000000b00304b5b2f5ffsm10972020wrt.53.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EC4971FFBC; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 08/10] tcg: remove the final vestiges of dstate Date: Tue, 23 May 2023 13:49:58 +0100 Message-Id: <20230523125000.3674739-9-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Now we no longer have dynamic state affecting things we can remove the additional fields in cpu.h and simplify the TB hash calculation. For the benchmark: hyperfine -w 2 -m 20 \ "./arm-softmmu/qemu-system-arm -cpu cortex-a15 \ -machine type=virt,highmem=off \ -display none -m 2048 \ -serial mon:stdio \ -netdev user,id=unet,hostfwd=tcp::2222-:22 \ -device virtio-net-pci,netdev=unet \ -device virtio-scsi-pci \ -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf \ -device scsi-hd,drive=hd -smp 4 \ -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage \ -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' \ -snapshot" It has a marginal effect on runtime, before: Time (mean ± σ): 26.279 s ± 2.438 s [User: 41.113 s, System: 1.843 s] Range (min … max): 24.420 s … 32.565 s 20 runs after: Time (mean ± σ): 24.440 s ± 2.885 s [User: 34.474 s, System: 2.028 s] Range (min … max): 21.663 s … 29.937 s 20 runs Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1358 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-9-alex.bennee@linaro.org> --- accel/tcg/tb-hash.h | 6 +++--- include/exec/exec-all.h | 3 --- include/hw/core/cpu.h | 5 ----- accel/tcg/cpu-exec.c | 7 +------ accel/tcg/tb-maint.c | 5 ++--- accel/tcg/translate-all.c | 6 ------ 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 83dc610e4c..1d19c69caa 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -61,10 +61,10 @@ static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc) #endif /* CONFIG_SOFTMMU */ static inline -uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, uint32_t flags, - uint32_t cf_mask, uint32_t trace_vcpu_dstate) +uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, + uint32_t flags, uint32_t cf_mask) { - return qemu_xxhash7(phys_pc, pc, flags, cf_mask, trace_vcpu_dstate); + return qemu_xxhash6(phys_pc, pc, flags, cf_mask); } #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index ecded1f112..3ee76af28b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -548,9 +548,6 @@ struct TranslationBlock { #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */ #define CF_CLUSTER_SHIFT 24 - /* Per-vCPU dynamic tracing state used to generate this TB */ - uint32_t trace_vcpu_dstate; - /* * Above fields used for comparing */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 39150cf8f8..383456d1b3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -266,7 +266,6 @@ typedef void (*run_on_cpu_func)(CPUState *cpu, run_on_cpu_data data); struct qemu_work_item; #define CPU_UNSET_NUMA_NODE_ID -1 -#define CPU_TRACE_DSTATE_MAX_EVENTS 32 /** * CPUState: @@ -407,10 +406,6 @@ struct CPUState { /* Use by accel-block: CPU is executing an ioctl() */ QemuLockCnt in_ioctl_lock; - /* Used for events with 'vcpu' and *without* the 'disabled' properties */ - DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS); - DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS); - DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX); #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index bc0e1c3299..973da2a434 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -175,7 +175,6 @@ struct tb_desc { tb_page_addr_t page_addr0; uint32_t flags; uint32_t cflags; - uint32_t trace_vcpu_dstate; }; static bool tb_lookup_cmp(const void *p, const void *d) @@ -187,7 +186,6 @@ static bool tb_lookup_cmp(const void *p, const void *d) tb_page_addr0(tb) == desc->page_addr0 && tb->cs_base == desc->cs_base && tb->flags == desc->flags && - tb->trace_vcpu_dstate == desc->trace_vcpu_dstate && tb_cflags(tb) == desc->cflags) { /* check next page if needed */ tb_page_addr_t tb_phys_page1 = tb_page_addr1(tb); @@ -228,7 +226,6 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, desc.cs_base = cs_base; desc.flags = flags; desc.cflags = cflags; - desc.trace_vcpu_dstate = *cpu->trace_dstate; desc.pc = pc; phys_pc = get_page_addr_code(desc.env, pc); if (phys_pc == -1) { @@ -236,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, } desc.page_addr0 = phys_pc; h = tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags, *cpu->trace_dstate); + flags, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } @@ -263,7 +260,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, jc->array[hash].pc == pc && tb->cs_base == cs_base && tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && tb_cflags(tb) == cflags)) { return tb; } @@ -282,7 +278,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, tb->pc == pc && tb->cs_base == cs_base && tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && tb_cflags(tb) == cflags)) { return tb; } diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 991746f80f..bc1961ea55 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -50,7 +50,6 @@ static bool tb_cmp(const void *ap, const void *bp) a->cs_base == b->cs_base && a->flags == b->flags && (tb_cflags(a) & ~CF_INVALID) == (tb_cflags(b) & ~CF_INVALID) && - a->trace_vcpu_dstate == b->trace_vcpu_dstate && tb_page_addr0(a) == tb_page_addr0(b) && tb_page_addr1(a) == tb_page_addr1(b)); } @@ -888,7 +887,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list) /* remove the TB from the hash list */ phys_pc = tb_page_addr0(tb); h = tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, orig_cflags, tb->trace_vcpu_dstate); + tb->flags, orig_cflags); if (!qht_remove(&tb_ctx.htable, tb, h)) { return; } @@ -969,7 +968,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, /* add in the hash table */ h = tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, tb->cflags, tb->trace_vcpu_dstate); + tb->flags, tb->cflags); qht_insert(&tb_ctx.htable, tb, h, &existing_tb); /* remove TB from the page(s) if we couldn't insert it */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 353849ca6d..6958ebecf6 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,11 +65,6 @@ #include "internal.h" #include "perf.h" -/* Make sure all possible CPU event bits fit in tb->trace_vcpu_dstate */ -QEMU_BUILD_BUG_ON(CPU_TRACE_DSTATE_MAX_EVENTS > - sizeof_field(TranslationBlock, trace_vcpu_dstate) - * BITS_PER_BYTE); - TBContext tb_ctx; /* @@ -352,7 +347,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base = cs_base; tb->flags = flags; tb->cflags = cflags; - tb->trace_vcpu_dstate = *cpu->trace_dstate; tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb = tb; From patchwork Tue May 23 12:49:59 2023 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: 684906 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697665wrt; Tue, 23 May 2023 05:50:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qFYWoR3qtreM8H+4kHCb1z58f+qZAbHYQQqgKgyi9oa1aVAFjhgPTbCBPA7eQU9m9LgKv X-Received: by 2002:ac8:7d0c:0:b0:3f5:3982:fa26 with SMTP id g12-20020ac87d0c000000b003f53982fa26mr25640705qtb.14.1684846225583; Tue, 23 May 2023 05:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846225; cv=none; d=google.com; s=arc-20160816; b=tUAs4e3P/XzU/GkGy2eLQ266RGwRK6yJmAg4l88LSlaKahVMce6ZyfGJ1+T1Eu3TFa SlshtW+6Zni6xp44YXqnYwvzhYnNMh+RuPhSaL/7JtlynvI62PzhhQb9IncT3GGSB9rs TyXAut+jl8wPkI029bdx7bZSoesKS/n7yQBa1loHuzS83ALJ4rXOJMEa95W8y7hwvuva s6jQE64MxNKc+S/kDbL87S6wPAiMq/2rksth0DFKYwsJFuXxxqYfDITQqDsPhc16/j2u iH/V+H6CHWlTeZkr1eDDX6vkzUs4wswJzHHoY59f03eHnRuNrwmovGyxKKUeTXQyhPP/ 2efg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=MAULMOGmT5H9o9RvsJMw7q1ybHoaRgcLnjhnEUukBq0WBIqodHSR7zgpt6GjZkgkWx kd9x9gBDOobx9I5uOjk+Wa33sD9si1NYEad0WbKqgAbYDXlyP45hl7rPT24MyUD9+cF+ 7mMlGslsgywVOLU1t9dG8RRSmsEgbebWDbYn9lSATOlrmUox/i2ddYNqjV7T/RsDn/Lj d/AcEBO82upUZIKLeyZMM00DAGefiaAlUwCRwWY8WRAnHNsGBI1HWtGPjB74D3jW2yLL Hw4ykRf+e2Y1bNhYccr042b07u1NNo8yH2VObF/ul7WvtVgXXymOyY+Xeyu17QjTgpsy +d5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=irV842Vm; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id z20-20020ac87f94000000b003e4e2eaa3adsi5231841qtj.65.2023.05.23.05.50.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=irV842Vm; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846225; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=irV842Vmn8lJM8zx3X+apEBQ0Sr5eZazQj0gkFFYdpHiTe1o4ubTG5zJ+aJ9hFpXnvMXfn xEA9XBwjvB6jgj1gkiw8JmsVSr8sHS236wlYD5IZcxnc76TM6MbxAbnScBYSaw8HSJaHRu XHNt5Q7Cf+Vd1A0qZhTezU0us4C88cE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-dldExJELPTSi16lm4Nfe4g-1; Tue, 23 May 2023 08:50:21 -0400 X-MC-Unique: dldExJELPTSi16lm4Nfe4g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79CF58030CD; Tue, 23 May 2023 12:50:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 644EB140E95D; Tue, 23 May 2023 12:50:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E05F719465B3; Tue, 23 May 2023 12:50:12 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE82919465A0 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B158E2029F6E; Tue, 23 May 2023 12:50:06 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A941E20296C8 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D397185A795 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-VjZAolb8PeW8H9gy0aUrJQ-1; Tue, 23 May 2023 08:50:04 -0400 X-MC-Unique: VjZAolb8PeW8H9gy0aUrJQ-1 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3078a3f3b5fso7298000f8f.0 for ; Tue, 23 May 2023 05:50:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846203; x=1687438203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=LLBK5BFwPo7WaC33J/6ibsWCLS7DzrhlBnRQzFv5u0Jbuax/rDQJukrkUA8qpe9qLc s1/bRsTxcoHUk1HetnnRN0NwFkffnyEJc98MZ6N5zVxPBJ8wUAyKQPNf7TISm00hoq+G hH9WdoagNksbd93W6LlrttiwSDFaO9tXYPEQbg50AGTUG8GpPJF1Vp5DtS9eyoefM1vY GIwRX/GUvLFdwLFVPpJ5+3WAUXUG3ZRW6qC3yOamHNj3+uEmXTRqcQn9aTunbVYae01B tfnbOE2fkcaO0uYZVDlSYHTnLZZr2SL1GIBqlzy4oFwprxFx3FqeI0dATDo5ptMirQu8 dPAA== X-Gm-Message-State: AC+VfDwKJSw2AXpLlBJXYHvyN4A3BglLkGn3R8+cSPE/qM901PWB69oN DP5REeYsORWtzJyxmy2ryPWi8g== X-Received: by 2002:a5d:40c2:0:b0:309:839:be3e with SMTP id b2-20020a5d40c2000000b003090839be3emr9870522wrq.33.1684846203793; Tue, 23 May 2023 05:50:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s3-20020a5d4243000000b002cea9d931e6sm10972862wrr.78.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0FACF1FFC2; Tue, 23 May 2023 13:50:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 09/10] hw/9pfs: use qemu_xxhash4 Date: Tue, 23 May 2023 13:49:59 +0100 Message-Id: <20230523125000.3674739-10-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org No need to pass zeros as we have helpers that do that for us. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-10-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-10-alex.bennee@linaro.org> --- hw/9pfs/9p.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9621ec1341..991645adca 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -738,15 +738,14 @@ static VariLenAffix affixForIndex(uint64_t index) return invertAffix(&prefix); /* convert prefix to suffix */ } -/* creative abuse of tb_hash_func7, which is based on xxhash */ static uint32_t qpp_hash(QppEntry e) { - return qemu_xxhash7(e.ino_prefix, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino_prefix, e.dev); } static uint32_t qpf_hash(QpfEntry e) { - return qemu_xxhash7(e.ino, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino, e.dev); } static bool qpd_cmp_func(const void *obj, const void *userp) From patchwork Tue May 23 12:50:00 2023 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: 684909 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697690wrt; Tue, 23 May 2023 05:50:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73tFn73DLWcSap5ncQAa+iKZizLUVFY91Db13a26hlL6j4QZKQXmkTL8p1rJQ8iSh3ZXYR X-Received: by 2002:a05:620a:8a16:b0:75b:23a1:3ef with SMTP id qt22-20020a05620a8a1600b0075b23a103efmr3533542qkn.5.1684846227612; Tue, 23 May 2023 05:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846227; cv=none; d=google.com; s=arc-20160816; b=icm4RcXlnpOqboMHPywUwhTzNVm7haAO1zHT7migGVuScRjYcrNMaP38b4MMoirxIJ frtZPk6g+4q49nX+V5CQSPLCeahwGD53gedamS1gyJ0mXjeIuppzd2ZuOnEV1+JxlEWS s8k/fwSq/Jcv2C8JEm3x3ESz9VqxtMHwuGOJVuUpbV7lpSgyNUn2eQs/rbNGKmE8wZY5 MNx+Xyz8afjE+qy/zNpCoBIz8csDC7aq00a5tGC7TcVaRcBtE7hv9vnninpI5+NNkkHL wor+UxcHhI+2MK6gKaUTDLW3HONDubQv+CvbT6ZPcjG637z36pKpbc0xwzczHCnfIhtr eiMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=XbrEYeLRCSl6VLZyK6Li2yMKXhUg0aU47cxa2yCHK5+aQB3gFPQcywaBL6KGV1i7qK QKStzaWBtHS1V9K5ylnoOhM/f7tzPIC2efYajB/Mdg84v4Zw5UcbqTwDVi+qaIxxUCXQ SWZJo+0ij2OinC2HaWQRNHanklJ4A0QrIvi1LJ+QijKOTrpQWIC3gz+X8Cd2XBaoXaSO Kzmp/Zg0NbcJTgxWU6dC1G1CJiMhMutdCR2qoO2xL9axHnnt085fyt/9kyPWTzTNjJMm e9txPh+aQc4E/3xIuB/FTh7iNeyih05FbKG9AHXeUCvv+du/4BHuloX9cgEpkRU4zL57 0XpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hBml5roA; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id e4-20020a05620a12c400b007490c58d340si4619858qkl.583.2023.05.23.05.50.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:27 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hBml5roA; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846227; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=hBml5roA4h3raorrQZckNLzkNS4KFvl2lGGrqgt3j1TqDrrmJj7gKZhIh+vUq7tv3kUkZ6 NWLQwio6HdnTjn/4INAbC9/3NGQbarhxzYErv15eJcTMawfNTEJFSBsZjMJr6ThsaPmXaH b5f1+SeYcWA8USfZ8PVuNsS7Uxn3h9I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-t6KOaixKPtqq2V6NuPQx2g-1; Tue, 23 May 2023 08:50:23 -0400 X-MC-Unique: t6KOaixKPtqq2V6NuPQx2g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5955280A0A2; Tue, 23 May 2023 12:50:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 437DA9D73; Tue, 23 May 2023 12:50:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6CAFF19451C7; Tue, 23 May 2023 12:50:18 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3043719465A8 for ; Tue, 23 May 2023 12:50:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0491E9D7A; Tue, 23 May 2023 12:50:09 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0DE89D73 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1837185A797 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-106-TtcaZvm1M7uswK4vcXtJJA-1; Tue, 23 May 2023 08:50:06 -0400 X-MC-Unique: TtcaZvm1M7uswK4vcXtJJA-1 Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-307a8386946so4852821f8f.2 for ; Tue, 23 May 2023 05:50:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846205; x=1687438205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=JPJOMA/VaL4K0Ux6yFV0tsHURDucDm8kS0el3Po53S/kRU3+AipyuyD+fg6Kv7ruhK ZLEOR8xNK4MS4i5D7yW8g0FFwgxd1i9gYBN8L27hE/uIIXbuyYHOIlrb53KRzbLnzZ/1 xO54jK7pi0VBNVBZIYu/dJ4hjbqwvTDrNP07Smd/0IFkG1fjrE6jNT2MHIFklR/rHEqA MWmLkfpnKtoJm8Yefe+rO2pC6GgSgQ/1gqPBGpw8dSZ5c9DtcSnZbcVlmOj0DVjapBN7 kEKxW8wJbrShOcMUOpQOMuUGDS0+aSQ4l9v6Z14VbNq6JIDZmOoUMv2KnfW/ZjBrqt+o oEcQ== X-Gm-Message-State: AC+VfDzEZFmEAm5Pc2Ho9ek6f4UyRL83N5wwPjNAURQV1t4FWMOjjPik r9uw3ag0GuYE9iDfhGC2SveVBA== X-Received: by 2002:a5d:58e3:0:b0:309:22ba:dcdc with SMTP id f3-20020a5d58e3000000b0030922badcdcmr10746334wrd.42.1684846205732; Tue, 23 May 2023 05:50:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e5-20020a5d4e85000000b003047dc162f7sm10966703wru.67.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 321C21FFBD; Tue, 23 May 2023 13:50:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 10/10] accel/tcg: include cs_base in our hash calculations Date: Tue, 23 May 2023 13:50:00 +0100 Message-Id: <20230523125000.3674739-11-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org We weren't using cs_base in the hash calculations before. Since the arm front end moved a chunk of flags in a378206a20 (target/arm: Move mode specific TB flags to tb->cs_base) they comprise of an important part of the execution state. Widen the tb_hash_func to include cs_base and expand to qemu_xxhash8() to accommodate it. My initial benchmark shows very little difference in the runtime. Before: armhf ➜ hyperfine -w 2 -m 20 "./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot" Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot Time (mean ± σ): 24.627 s ± 2.708 s [User: 34.309 s, System: 1.797 s] Range (min … max): 22.345 s … 29.864 s 20 runs arm64 ➜ hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=on -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22,hostfwd=tcp::1234-:1234 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark-pigz.service' -snapshot" Benchmark 1: 20 Time (mean ± σ): 62.559 s ± 2.917 s [User: 189.115 s, System: 4.089 s] Range (min … max): 59.997 s … 70.153 s 10 runs After: armhf Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot Time (mean ± σ): 24.223 s ± 2.151 s [User: 34.284 s, System: 1.906 s] Range (min … max): 22.000 s … 28.476 s 20 runs arm64 hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=on -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22,hostfwd=tcp::1234-:1234 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark-pigz.service' -snapshot" Benchmark 1: 20 Time (mean ± σ): 62.769 s ± 1.978 s [User: 188.431 s, System: 5.269 s] Range (min … max): 60.285 s … 66.868 s 10 runs Signed-off-by: Alex Bennée --- v4 - use an additional 64 bit argument, shuffle qsp usage --- accel/tcg/tb-hash.h | 4 ++-- include/qemu/xxhash.h | 23 +++++++++++++++++------ accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 4 ++-- util/qsp.c | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 1d19c69caa..2ba2193731 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -62,9 +62,9 @@ static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc) static inline uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, - uint32_t flags, uint32_t cf_mask) + uint32_t flags, uint64_t flags2, uint32_t cf_mask) { - return qemu_xxhash6(phys_pc, pc, flags, cf_mask); + return qemu_xxhash8(phys_pc, pc, flags2, flags, cf_mask); } #endif diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index c2dcccadbf..8a5ad1f1f3 100644 --- a/include/qemu/xxhash.h +++ b/include/qemu/xxhash.h @@ -48,8 +48,8 @@ * xxhash32, customized for input variables that are not guaranteed to be * contiguous in memory. */ -static inline uint32_t -qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) +static inline uint32_t qemu_xxhash8(uint64_t ab, uint64_t cd, uint64_t ef, + uint32_t g, uint32_t h) { uint32_t v1 = QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2; uint32_t v2 = QEMU_XXHASH_SEED + PRIME32_2; @@ -59,6 +59,8 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) uint32_t b = ab >> 32; uint32_t c = cd; uint32_t d = cd >> 32; + uint32_t e = ef; + uint32_t f = ef >> 32; uint32_t h32; v1 += a * PRIME32_2; @@ -89,6 +91,9 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) h32 += g * PRIME32_3; h32 = rol32(h32, 17) * PRIME32_4; + h32 += h * PRIME32_3; + h32 = rol32(h32, 17) * PRIME32_4; + h32 ^= h32 >> 15; h32 *= PRIME32_2; h32 ^= h32 >> 13; @@ -100,23 +105,29 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) static inline uint32_t qemu_xxhash2(uint64_t ab) { - return qemu_xxhash7(ab, 0, 0, 0, 0); + return qemu_xxhash8(ab, 0, 0, 0, 0); } static inline uint32_t qemu_xxhash4(uint64_t ab, uint64_t cd) { - return qemu_xxhash7(ab, cd, 0, 0, 0); + return qemu_xxhash8(ab, cd, 0, 0, 0); } static inline uint32_t qemu_xxhash5(uint64_t ab, uint64_t cd, uint32_t e) { - return qemu_xxhash7(ab, cd, e, 0, 0); + return qemu_xxhash8(ab, cd, e, 0, 0); } static inline uint32_t qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f) { - return qemu_xxhash7(ab, cd, e, f, 0); + return qemu_xxhash8(ab, cd, e, f, 0); +} + +static inline uint32_t qemu_xxhash7(uint64_t ab, uint64_t cd, uint64_t ef, + uint32_t g) +{ + return qemu_xxhash8(ab, cd, ef, g, 0); } /* diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 973da2a434..8d67198e56 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -233,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, } desc.page_addr0 = phys_pc; h = tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags); + flags, cs_base, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index bc1961ea55..892eecda2d 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -887,7 +887,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb, bool rm_from_page_list) /* remove the TB from the hash list */ phys_pc = tb_page_addr0(tb); h = tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, orig_cflags); + tb->flags, tb->cs_base, orig_cflags); if (!qht_remove(&tb_ctx.htable, tb, h)) { return; } @@ -968,7 +968,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, /* add in the hash table */ h = tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, tb->cflags); + tb->flags, tb->cs_base, tb->cflags); qht_insert(&tb_ctx.htable, tb, h, &existing_tb); /* remove TB from the page(s) if we couldn't insert it */ diff --git a/util/qsp.c b/util/qsp.c index 8562b14a87..2fe3764906 100644 --- a/util/qsp.c +++ b/util/qsp.c @@ -144,7 +144,7 @@ uint32_t do_qsp_callsite_hash(const QSPCallSite *callsite, uint64_t ab) uint32_t e = callsite->line; uint32_t f = callsite->type; - return qemu_xxhash6(ab, cd, e, f); + return qemu_xxhash8(ab, cd, 0, e, f); } static inline