From: SourceForge.net <no...@so...> - 2006-12-27 15:00:24
|
Bugs item #1622757, was opened at 2006-12-27 07:39 Message generated for change (Comment added) made by movement You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116191&aid=1622757&group_id=16191 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: erpo41 (erpo41) Assigned to: Nobody/Anonymous (nobody) Summary: opcontrol fails on Ubuntu 6.10 (Edgy Eft) Initial Comment: DISCLAIMER: I am new to oprofile. -------------------------- The Problem opcontrol fails when I run it on both of my linux boxes. Both are Ubuntu 6.10 (Edgy Eft). -------------------------- What I Did I ran the command line: sudo opcontrol --no-vmlinux --start and the following output was printed: Using default event: CPU_CLK_UNHALTED:100000:0:1:1 /usr/bin/opcontrol: 1: arith: syntax error: "NR_CHOSEN - 1" No events given. -------------------------- The Stopgap Fix After a bunch of troubleshooting, I tracked the problem down to /bin/sh (the interpreter for opcontrol) being symlinked to /bin/dash in my distro instead of /bin/bash. This command line works: sudo bash opcontrol --no-vmlinux --start ------------------------- Permanent Solution Options 1. The interpreter for opcontrol could be changed from one that sometimes does not work (i.e. /bin/sh) to one that works (i.e. /bin/bash). 2. opcontrol, and possibly other programs related to oprofile, could be rewritten to work with dash. 3. A warning could be printed if opcontrol detects that it is being interpreted by dash. However, for some reason, the SHELL variable is set to /bin/bash inside dash. I have no idea why this is done, but it means the SHELL variable is not a reliable method of detecting which shell is being used. ---------------------------------------------------------------------- >Comment By: John Levon (movement) Date: 2006-12-27 15:00 Message: Logged In: YES user_id=53034 Originator: NO The script is supposed to be shell agnostic. I'm not sure whether $((FOO - 1)) is POSIX or not. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=116191&aid=1622757&group_id=16191 |