bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gprofng/30700] tmpdir/gp-collect-app_F test fails


From: vladimir.mezentsev at oracle dot com
Subject: [Bug gprofng/30700] tmpdir/gp-collect-app_F test fails
Date: Thu, 03 Aug 2023 03:33:43 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30700

Vladimir Mezentsev <vladimir.mezentsev at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #10 from Vladimir Mezentsev <vladimir.mezentsev at oracle dot com> 
---
This test tests the -F option (-F on, -F off, -F <regexp>).
The test profiles this command:
    sh -c 'mkdir t && touch t/x; rm -rf t'
and looks at how many sub-experiments have been created.

The test uses `find $tdir -name '*x1.er' | wc -l` to count sub-experiments.
This is wrong in Debian.

In RH/OL, sh runs fork() -> exec() for each command.
In this case, gprofng creates these sub-experiments:
% ls -1d tmpdir/gp-collect-app_F/exp.er/*er
tmpdir/gp-collect-app_F/exp.er/_f1_x0_x1.er
tmpdir/gp-collect-app_F/exp.er/_f2_x0_x1.er
tmpdir/gp-collect-app_F/exp.er/_f3_x0_x1.er

In Debian, sh runs vfork() -> exec().
In this case, gprofng creates these sub-experiments:
% ls -1d tmpdir/gp-collect-app_F/exp.er/*er
tmpdir/gp-collect-app_F/exp.er/_x1.er
tmpdir/gp-collect-app_F/exp.er/_x2.er
tmpdir/gp-collect-app_F/exp.er/_x3.er


Proposed fix:
% git diff
diff --git a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
index f791b0f7a95..02bcc8e5b49 100644
--- a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
+++ b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp
@@ -46,11 +46,11 @@ proc run_gp_collect_app { subExpCnt F_opt } {
     return -code break
   }

-  set output [run_native_host_cmd "find $tdir -name '*x1.er' | wc -l"]
+  set output [run_native_host_cmd "find $tdir -name '*_x?.er' | wc -l"]
   set subExp [lindex $output 1]
   if { $subExp != $subExpCnt } then {
     set out [lindex $output 1]
-    send_log "Test failed for -F $F_opt. subExp=$subExp. Shold be
$subExpCnt\n"
+    send_log "Test failed for -F $F_opt. subExp=$subExp. Should be
$subExpCnt\n"
     fail $tdir
     return -code break
   }

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]