Phoronix Forums  

Go Back   Phoronix Forums > Phoronix > Phoronix Test Suite

Phoronix Test Suite Discussion & collaboration on the Phoronix Test Suite software and specification.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2008, 09:54 PM
uncle_fungus uncle_fungus is offline
Phoronix Test Suite
 
Join Date: Apr 2008
Location: York, UK
Posts: 134
Default Patch to extend functionality of process checker

This patch allows applications with non-matching process names to be detected. It also accommodates distros that use different names for the same applications by allowing multiple process names to be set per application (see firefox and thunderbird changes).

Code:
diff --git a/pts-core/functions/pts-functions_system.php b/pts-core/functions/pts-functions_system.php
index 81458af..e56c2b5 100644
--- a/pts-core/functions/pts-functions_system.php
+++ b/pts-core/functions/pts-functions_system.php
@@ -15,9 +15,17 @@ function pts_process_running_string($process_arr)
        if(!is_array($process_arr))
                $process_arr = array($process_arr);

-       foreach($process_arr as $process)
-               if(pts_process_running_bool($process))
-                       array_push($p, $process);
+       foreach($process_arr as $p_name => $p_process)
+       {
+               if(!is_array($p_process))
+                       $p_process = array($p_process);
+
+               foreach($p_process as $process)
+                       if(pts_process_running_bool($process))
+                               array_push($p, $p_name);
+       }
+
+       $p = array_keys(array_flip($p));

        if(($p_count = count($p)) > 0)
        {

diff --git a/pts-core/pts-run-benchmark.php b/pts-core/pts-run-benchmark.php
index b456fd7..60e65f7 100644
--- a/pts-core/pts-run-benchmark.php
+++ b/pts-core/pts-run-benchmark.php
@@ -231,7 +231,13 @@ else

 if($SAVE_RESULTS)
 {
-       $test_notes = pts_process_running_string(array("Compiz", "Firefox", "Thunderbird"));
+       $running_process=array(
+               "Compiz" => array("compiz"),
+               "Firefox" => array("firefox","mozilla-firefox","mozilla-firefox-bin"),
+               "Thunderbird" => array("thunderbird", "mozilla-thunderbird", "mozilla-thunderbird-bin")
+       );
+
+       $test_notes = pts_process_running_string($running_process);

        if(defined("TEST_GRAPHICS"))
        {
Reply With Quote
  #2  
Old 05-02-2008, 07:43 AM
Michael Michael is offline
Phoronix
 
Join Date: Jun 2006
Location: United States
Posts: 4,564
Default

Committed to git, thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2009 by Phoronix Media.