init.qti.usb.debug: Only enable ftrace on non-perf kernels

Only enable USB ftrace events on non-perf images in order to
reduce memory overhead of the additional tracing instances.
Borrow the same check from kernel scripts which check for the
presence of the msm_rtb module.

Also remove the additional "&& property:ro.build.type=userdebug"
condition on the init trigger since this is already implied
with the vendor_product.mk pickup rules which determine the
inclusion of the debug rc/sh in the build, and additionally
allow it to work on "eng" build variants.

Change-Id: I3071717d20fafb94e75bc29af68e41e87d90f17a
diff --git a/etc/init.qti.usb.debug.rc b/etc/init.qti.usb.debug.rc
index f0c3602..7876362 100644
--- a/etc/init.qti.usb.debug.rc
+++ b/etc/init.qti.usb.debug.rc
@@ -26,5 +26,5 @@
 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-on init && property:ro.build.type=userdebug
+on init
     exec u:r:vendor-qti-testscripts:s0 -- /vendor/bin/sh /vendor/bin/init.qti.usb.debug.sh
diff --git a/etc/init.qti.usb.debug.sh b/etc/init.qti.usb.debug.sh
index 97565fa..203679d 100644
--- a/etc/init.qti.usb.debug.sh
+++ b/etc/init.qti.usb.debug.sh
@@ -27,7 +27,12 @@
 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-# Enable various ftrace debugging events
+# bail out if its perf config
+if [ ! -d /sys/module/msm_rtb ]; then
+    return
+fi
+
+# Enable various ftrace debugging events for USB
 tracefs=/sys/kernel/tracing
 
 if [ -d $tracefs ]; then