From patchwork Mon Jan 25 11:09:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 1431148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LREf3XAi; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DPRyP10XNz9sVS for ; Mon, 25 Jan 2021 22:11:38 +1100 (AEDT) Received: from localhost ([::1]:54370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3zmP-0003ha-62 for incoming@patchwork.ozlabs.org; Mon, 25 Jan 2021 06:11:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3zll-0003hD-Lh for qemu-devel@nongnu.org; Mon, 25 Jan 2021 06:10:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l3zlg-0007x4-Tg for qemu-devel@nongnu.org; Mon, 25 Jan 2021 06:10:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611573044; h=from:from: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; bh=V8Zc1JZM731ctc953UzVyJGmZ0k77xxUblhTXrU3ZKE=; b=LREf3XAivDUO8lrOLWnSqu4zKL7jVzxdvnPx0uN2ZQOlAM1VuxYX81QirtBlKG3HJDltFh oCJqaDegDaa6n/qkJ1+S1fm0PS+HU1HjEXT2f1MLSn/4Gi2EfIhSBs1zq5SlyOU5uFWW7b wtK77kTEHe8xOH9eZyUpxV0PZsTRCIY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-19nrAxMnOHqrISOdUrycKw-1; Mon, 25 Jan 2021 06:10:40 -0500 X-MC-Unique: 19nrAxMnOHqrISOdUrycKw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE6058B94D7; Mon, 25 Jan 2021 11:10:26 +0000 (UTC) Received: from localhost (ovpn-115-94.ams2.redhat.com [10.36.115.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 889B171C9E; Mon, 25 Jan 2021 11:09:59 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH] trace: add meson custom_target() depend_files for tracetool Date: Mon, 25 Jan 2021 11:09:58 +0000 Message-Id: <20210125110958.214017-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=stefanha@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Re-generate tracetool output when the tracetool source code changes. Use the same approach as qapi_gen_depends and introduce a tracetool_depends files list so meson is aware of the dependencies. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- meson.build | 28 +++++++++++++++++++++++++++- trace/meson.build | 21 ++++++++++++++------- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 35a9eddf5c..3909d6b4c1 100644 --- a/meson.build +++ b/meson.build @@ -1626,6 +1626,31 @@ tracetool = [ python, files('scripts/tracetool.py'), '--backend=' + config_host['TRACE_BACKENDS'] ] +tracetool_depends = files( + 'scripts/tracetool/backend/log.py', + 'scripts/tracetool/backend/__init__.py', + 'scripts/tracetool/backend/dtrace.py', + 'scripts/tracetool/backend/ftrace.py', + 'scripts/tracetool/backend/simple.py', + 'scripts/tracetool/backend/syslog.py', + 'scripts/tracetool/backend/ust.py', + 'scripts/tracetool/format/tcg_h.py', + 'scripts/tracetool/format/ust_events_c.py', + 'scripts/tracetool/format/ust_events_h.py', + 'scripts/tracetool/format/__init__.py', + 'scripts/tracetool/format/d.py', + 'scripts/tracetool/format/tcg_helper_c.py', + 'scripts/tracetool/format/simpletrace_stap.py', + 'scripts/tracetool/format/c.py', + 'scripts/tracetool/format/h.py', + 'scripts/tracetool/format/tcg_helper_h.py', + 'scripts/tracetool/format/log_stap.py', + 'scripts/tracetool/format/stap.py', + 'scripts/tracetool/format/tcg_helper_wrapper_h.py', + 'scripts/tracetool/__init__.py', + 'scripts/tracetool/transform.py', + 'scripts/tracetool/vcpu.py' +) qemu_version_cmd = [find_program('scripts/qemu-version.sh'), meson.current_source_dir(), @@ -2192,7 +2217,8 @@ foreach target : target_dirs '--target-type=' + target_type, '--probe-prefix=qemu.' + target_type + '.' + target_name, '@INPUT@', '@OUTPUT@' - ]) + ], + depend_files: tracetool_depends) endforeach endif endforeach diff --git a/trace/meson.build b/trace/meson.build index a0be8f9b0d..08f83a15c3 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -12,17 +12,20 @@ foreach dir : [ '.' ] + trace_events_subdirs trace_h = custom_target(fmt.format('trace', 'h'), output: fmt.format('trace', 'h'), input: trace_events_file, - command: [ tracetool, group, '--format=h', '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, group, '--format=h', '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) genh += trace_h trace_c = custom_target(fmt.format('trace', 'c'), output: fmt.format('trace', 'c'), input: trace_events_file, - command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, group, '--format=c', '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) if 'CONFIG_TRACE_UST' in config_host trace_ust_h = custom_target(fmt.format('trace-ust', 'h'), output: fmt.format('trace-ust', 'h'), input: trace_events_file, - command: [ tracetool, group, '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, group, '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) trace_ss.add(trace_ust_h, lttng, urcubp) genh += trace_ust_h endif @@ -31,7 +34,8 @@ foreach dir : [ '.' ] + trace_events_subdirs trace_dtrace = custom_target(fmt.format('trace-dtrace', 'dtrace'), output: fmt.format('trace-dtrace', 'dtrace'), input: trace_events_file, - command: [ tracetool, group, '--format=d', '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, group, '--format=d', '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) trace_dtrace_h = custom_target(fmt.format('trace-dtrace', 'h'), output: fmt.format('trace-dtrace', 'h'), input: trace_dtrace, @@ -66,7 +70,8 @@ foreach d : [ gen = custom_target(d[0], output: d[0], input: meson.source_root() / 'trace-events', - command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) specific_ss.add(when: 'CONFIG_TCG', if_true: gen) endforeach @@ -74,11 +79,13 @@ if 'CONFIG_TRACE_UST' in config_host trace_ust_all_h = custom_target('trace-ust-all.h', output: 'trace-ust-all.h', input: trace_events_files, - command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, '--group=all', '--format=ust-events-h', '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) trace_ust_all_c = custom_target('trace-ust-all.c', output: 'trace-ust-all.c', input: trace_events_files, - command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@', '@OUTPUT@' ]) + command: [ tracetool, '--group=all', '--format=ust-events-c', '@INPUT@', '@OUTPUT@' ], + depend_files: tracetool_depends) trace_ss.add(trace_ust_all_h, trace_ust_all_c) genh += trace_ust_all_h endif