Sha256: 023b33874bf6e9ffcc3b19dbbd3eaa36a1730c1eb0dc60346c4398df1949af9e

Contents?: true

Size: 875 Bytes

Versions: 15

Compression:

Stored size: 875 Bytes

Contents

#!/usr/bin/env perl
use strict;
use warnings;
use Digest::MD5 qw(md5_hex);

my $HDR = "** $0:";
$\="\n";

my $DT_SRC = shift @ARGV;
my $CMD = shift @ARGV;

my @O_FILES = grep { $_ =~ /\.o$/ } @ARGV;
if (!scalar @O_FILES) {
    # Assume this isn't an actual link command?
    print"$HDR Assuming this isn't an LD/AR invocation. Continuing..";
    exec($CMD,@ARGV);
}

my $ss = join('_', @O_FILES);
my $hexstr = md5_hex($ss);

my $INSTRUMENTED = "generated/probes_${hexstr}.o";
# Run DTrace instrumentation. Assuming running from build directory:
my @args = (
    'dtrace', '-C', '-G',
    '-s', $DT_SRC,
    '-o', $INSTRUMENTED,
    @O_FILES);

print "$HDR: Creating instrumented DTrace object: @args";
if (system(@args) != 0) {
    exit(1);
}

unshift @ARGV, $CMD;
push @ARGV, $INSTRUMENTED;
print "$HDR: Linking with instrumented DTrace object: @ARGV";
exit(system(@ARGV));

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
libcouchbase-1.0.1 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-1.0.0 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.3.3 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.3.1 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.2.0 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.1.0 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.9 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.8 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.7 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.6 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.5 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.4 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.3 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.2 ext/libcouchbase/cmake/dtrace-instr-link.pl
libcouchbase-0.0.1 ext/libcouchbase/cmake/dtrace-instr-link.pl