summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-12-31 18:37:08 +0100
committerGitHub <noreply@github.com>2017-12-31 18:37:08 +0100
commit125e0612222925486c7911433fb286092add98a7 (patch)
tree5f97e0a74dab8701194b34f9b46d44e891f2bf59
parent67bcfc3fe5a24e48bb9d0720d5ea7b687db4e368 (diff)
downloadbugzilla-125e0612222925486c7911433fb286092add98a7.tar.gz
bugzilla-125e0612222925486c7911433fb286092add98a7.tar.xz
no bug - add utility to toggle USE_NYTPROF (#323)
-rw-r--r--vagrant_support/apache.j21
-rw-r--r--vagrant_support/devtools.yml3
-rw-r--r--vagrant_support/use-nytprof12
3 files changed, 16 insertions, 0 deletions
diff --git a/vagrant_support/apache.j2 b/vagrant_support/apache.j2
index 0a39125ce..722ebad92 100644
--- a/vagrant_support/apache.j2
+++ b/vagrant_support/apache.j2
@@ -1,4 +1,5 @@
PerlSwitches -wT
+PerlSetEnv USE_NYTPROF 0
PerlConfigRequire /vagrant/mod_perl.pl
<IfModule mpm_prefork_module>
diff --git a/vagrant_support/devtools.yml b/vagrant_support/devtools.yml
index fa554ce3c..3d4c9dbcd 100644
--- a/vagrant_support/devtools.yml
+++ b/vagrant_support/devtools.yml
@@ -18,6 +18,9 @@
- name: copy re.pl
copy: src=re.pl dest=/usr/local/bin/re.pl mode=0755
+- name: copy use-nytprof
+ copy: src=use-nytprof dest=/usr/local/bin/use-nytprof mode=0755
+
- name: mkdir .re.pl
file: path=/home/vagrant/.re.pl state=directory owner=vagrant group=vagrant mode=0775
diff --git a/vagrant_support/use-nytprof b/vagrant_support/use-nytprof
new file mode 100644
index 000000000..7c9dd3fba
--- /dev/null
+++ b/vagrant_support/use-nytprof
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+USE_NYTPROF="$1"
+if [[ -z $USE_NYTPROF ]]; then
+ USE_NYTPROF=1
+fi
+
+perl -e 'warn "Devel::NYTProf is ", $ARGV[0] ? "enabled" : "disabled", "\n";' "$USE_NYTPROF"
+
+sudo env USE_NYTPROF="$USE_NYTPROF" perl -i -pe 's/^\s*(PerlSetEnv\s+USE_NYTPROF\b).*$/$1 $ENV{USE_NYTPROF}/gmi' \
+ /etc/httpd/conf.d/bugzilla.conf
+sudo service httpd restart \ No newline at end of file