Skip to content

Commit

Permalink
Bug 1253622 - Move the mozilla-trace.h generation into moz.build; r=ted
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Mar 7, 2016
1 parent c916e5c commit d8255d9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
14 changes: 0 additions & 14 deletions probes/Makefile.in

This file was deleted.

12 changes: 12 additions & 0 deletions probes/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
# 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']
15 changes: 15 additions & 0 deletions probes/trace-gen.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit d8255d9

Please sign in to comment.