summaryrefslogtreecommitdiff
path: root/system/dtrace
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2021-11-23 04:27:32 -0500
committerMatt A. Tobin <email@mattatobin.com>2021-11-23 04:27:32 -0500
commit91ce8b18174dcff3eeba770bd280eb5af0df98ca (patch)
tree822ec21cffe148c35d3ea389c920ea0e2d4e06c7 /system/dtrace
parent96e1a7d23192af51d38dbd7a243e89ce4ef6dd8b (diff)
downloadaura-central-91ce8b18174dcff3eeba770bd280eb5af0df98ca.tar.gz
Issue %3005 - Move memory/mfbt/mozglue to system/ as memory, framework, and utils respectively
Diffstat (limited to 'system/dtrace')
-rw-r--r--system/dtrace/moz.build17
-rw-r--r--system/dtrace/mozilla-trace.d23
-rw-r--r--system/dtrace/trace-gen.py15
3 files changed, 55 insertions, 0 deletions
diff --git a/system/dtrace/moz.build b/system/dtrace/moz.build
new file mode 100644
index 000000000..8c30c7fbc
--- /dev/null
+++ b/system/dtrace/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+if CONFIG['HAVE_DTRACE']:
+ EXPORTS += [
+ '!mozilla-trace.h',
+ ]
+
+ GENERATED_FILES += [
+ 'mozilla-trace.h',
+ ]
+
+ trace = GENERATED_FILES['mozilla-trace.h']
+ trace.script = 'trace-gen.py'
+ trace.inputs += ['mozilla-trace.d']
diff --git a/system/dtrace/mozilla-trace.d b/system/dtrace/mozilla-trace.d
new file mode 100644
index 000000000..cf4158c94
--- /dev/null
+++ b/system/dtrace/mozilla-trace.d
@@ -0,0 +1,23 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/*
+ * mozilla provider probes:
+ * Data types defined in the generated file mozilla-trace.h
+ *
+ * TBD
+ */
+
+provider mozilla {
+ /* Probe definitions go here */
+};
+
+/*
+#pragma D attributes Unstable/Unstable/Common provider mozilla provider
+#pragma D attributes Private/Private/Unknown provider mozilla module
+#pragma D attributes Private/Private/Unknown provider mozilla function
+#pragma D attributes Unstable/Unstable/Common provider mozilla name
+#pragma D attributes Unstable/Unstable/Common provider mozilla args
+*/
+
diff --git a/system/dtrace/trace-gen.py b/system/dtrace/trace-gen.py
new file mode 100644
index 000000000..586ad01f8
--- /dev/null
+++ b/system/dtrace/trace-gen.py
@@ -0,0 +1,15 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+import subprocess
+
+def main(fp, input):
+ temporary_file = 'mozilla-trace.h.tmp'
+ subprocess.check_call(['dtrace', '-x', 'nolibs', '-h', '-s', input, '-o', temporary_file])
+
+ with open(temporary_file, 'r') as temporary_fp:
+ output = temporary_fp.read()
+ fp.write(output.replace('if _DTRACE_VERSION', 'ifdef INCLUDE_MOZILLA_DTRACE'))
+ os.remove(temporary_file)