in reply to Profiling suid CGIs

Just temporarily make the script not setuid, and run it as the user it used to be setuid to. For example, if it's setuid root, su to root, remove the setuid bit, then profile as normal.

If that's not possible because it would interfere with a running system, make a copy of the script that's not setuid.