uable to profile with oprofile - c++

I am using cent os 5.5 .
Linux localhost.localdomain 2.6.18-164.el5xen #1 SMP Thu Sep 3 04:03:03 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
I am trying to profile my project(server) with oprofile written in c++.
So, for that i am using eclipse Helios Service Release 2 and it has a plugin for oprofile. I have installed the plugin through eclipse. but when i try to profile with oprofile a message bos pop up saying that,
"An error has occurred. See error log for more details.
java.lang.ExceptionInInitializerError"
I have also tried with eclipse plugin gprof. It creates the gmon.out file but unfortunately it did not take any sample. It can only show the number of times qa function is called but it couldnt show the duration of time a function executes. Can pls anyone tell me why this is happening ?
can anyone tell me if cent os kernel support profiling with oprofile.
My project is a server written in c++. It has shared libraries and it is multithreaded.It is not much efficient. So i am trying to find out where it is spending much time and where it is overloading the cpu.
It would be a gr8 help if anyone can tell me how i can profile my server with oprofile or gprof in eclipse in a proper way.I am prefering eclipse because it shows the gmon.out or the output of oprofile in much more understandable way
Thank you

I don't know about gprof.
But oprofile should work on centos.
You need to make sure you have opcontrol rpm installed.
Otherwise you can get the source and build it and install it.
http://oprofile.sourceforge.net/faq/

Related

NVidia NSight "process creation failure"

When launching my game from NVidia NSight, I get the following error message:
Preparing to launch...
Launch failure: Process creation failure
Launch failed.
The game launches just fine, but with no way to attach to it, I can't do frame debugging or anything else. There is no other error message or information that is logged. This is on Arch Linux.
This is probably not the answer you were hoping for, but after running into the same problem, I sent a bug report to Nvidia (https://developer.nvidia.com/rdp/bugs/nsight-graphics-bug-reporting) and I was told that Arch isn't supported at the moment (see https://developer.nvidia.com/nsight-graphics-requirements).
It's possible that, if there is enough demand, support could be added. So feel free to send them some feedback/request as well.
As an alternative, for debugging, RenderDoc works well enough on Arch, but it's not very good for profiling.
FYI, Arch Linux has now been officially supported by Nsight Graphics.
Ubuntu 18.04, 20.04
RHEL 7.6
Centos 7.6
Arch Linux 2021.05.01
https://developer.nvidia.com/nsight-graphics-requirements

Eclipse error during remote debug session: sh: locale: not found

I'm really hoping to get an answer on this. I am using Eclipse to remote debug a C++ program on a (minimal) linux machine. I am aware that the linux machine does not have the locale binary installed. First off, the error received is the following in Eclipse after pressing the debug or run button:
org.eclipse.remote.core.exception.RemoteConnectionException: sh:
locale: not found
After the first run, successive runs do not display the error, only the first run. If I restart the linux machine, the error will come back for the first run again.
What is most obvious is that Eclipse, or the running program is calling locale on the linux machine and it is not available, not installed.
This machine is quite minimal and doesn't even have a package manager - it's an embedded system. So I tried to install "locales", "locale" as well as "locale-all" using multistrap when building the linux image. None worked.
When using debian repositories, multistrap returns
E: Unable to locate packages locales
So I guess my real questions are:
1) What debian package supplies "locale" found in /usr/bin/locale? How
can I install it without adding a lot of of overhead on an ARM system? (assuming no package manager)
2) Where is the source code for locale?
And third,
3) In Eclipse, can I prevent the running program or Eclipse from
calling locale? This is preferred.
After scouring the forums, I found one guy that said he got the same issue and "manually fixed it", however he did not provide the fix.. Hope to get some help!
That reference can be found https://www.eclipse.org/forums/index.php/t/1081283/
Thanks,
I had the same, so I changed the encoding to ISO-8859-1 in the debug settings.

can't run a simple program in CLion

I'm VERY new to CLion so please be gentle :)
I took a project I did for a programming course I'm taking, I managed to build it, but when I tried to run it the CLion just freezes. I tried to run it in debug mode, but no success there either - it waits for a few seconds and then I recieve a message: "command timed out".
I thought the problem might be in my program, so I wrote a simple "Hello World" program - still no success.
few technical specs that might help:
I use CLion 1.2.1 (Newest version).
For my toolchains I use TDM-GCC compiler (downloaded from here: http://tdm-gcc.tdragon.net/download) - I actually do not use the newest version - I use version 4.9.2-3 instead - because I wanted the GDB to be 7.8 so Clion supports it).
My computer runs windows 10 (64 bit), intel core i5-4210U, 8 GB RAM (for what it's worth...)
hope you could help me.
Avast antivirus running … changing its setting as you can find here Stop avast! from attacking my own programs can help...
– nnn

Eclipse C++ GDB debugger for Mac

i've been trying for a whole day to use Eclipse but i failed every time.
I know that i may be wrong and i do know that there are a lot of people out there who are working hard for an open source project, but if i can't use a program, run and debug an "Hello world" file, there must be something wrong.
I'm using OSX 10.9.5 (yeah, maybe using a mac is my first error, right?).
Every time i try to debug the "Hello World.cpp" program i get the following error.
http://imgur.com/RgXCSyW
Yes, i've searched everywhere on google.
Yes, i've already seen the other replies on a similar topic and i've already tried the solutions they offered. Sadly, it didn't work.
Thanks guys for your patience, i hope to learn how to code and maybe being helpful to others one day.
Luca
p.s. writing the error so other people who are googling it can find it
"
Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Unable to find Mach task port for process-id 33383: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))
Unable to find Mach task port for process-id 33383: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))
"
There is another option to debug you code using LLDB debugger.
You can check this link for install the LLDB debugger integration.
It is super easy and does the work.
Btw The GDB debugger is part of GNU. Xcode does not use GNU tools (gcc, gdb) anymore. Xcode uses LLVM. LLVM's debugger is LLDB.
Some info about it:
apple developers,
The LLDB Debugger
Probably your problem has been solved, but sharing another solution to others cant be bad :)
This is relevant to macOS Sierra also.
This is a relatively well known "issue" on OS X (which btw is a pain-in-the-neck-to-develop-c++ on). You first need to install g++ and GDB debugger (since LLVM clang++ in combination with LLVM debugger are not yet supported by Eclipse on OS X). The easiest way is via macports. First install macports via the native installer, then, from a terminal, install g++ and gdb (debugger)
sudo port install gcc5 # or gcc49
and
sudo port install gdb
After this, you need to codesign it, see this link. The name of the debugger will be ggdb (not gdb), and macoprts will install it in /opt/local/bin/ggdb.

How to do remote debugging with Eclipse CDT without gdbserver?

We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host.
Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX.
Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?
finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.
In Main C/C++ Applications I set the full path on the Samba share of the executable (X:\abin\vlmi9506). I also set a linked folder on X:\abin in the project. Then I modified my batch-script in GDB Setup. It's not directly calling gdb in the plink-session but a unix-shell-script, which opens gdb. By this I have the possibility to set some unix environment-variables for the program before doing debug. The call in my batch:
plink.exe prevoax1 -l suttera -pw XXXXX -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m
In the unix script I started gdb with the command line params from eclipse, that I found in my former tryals. The call in the shell command looks like this:
gdb -nw -i mi -cd=$LVarPathExec $LVarPathExec/vlmi9506
Then IBM just gives gdb 6.0 for AIX. I found version 6.8 in the net at http://www.perzl.org/aix/index.php?n=Main.Gdb. Our Admin installed it.
I can now step through the program and watch variables. I even can write gdb-commands directly in the console-view. yabadabadooooooo
Hope that helps to others as well. Can not tell, what was really the winner-action.
But each answer gives more new questions. Now I got 3 of them.
When I start the debug config I have to click restart in the toolbar to come really in the main procedure. Is it possible to come directly in main without restarting?
On AIX our programs are first preprocessed for embedded sql. The preprocessed c-source is put in another directory. When I duble-click the line to set a breakpoint, I get the warning "unresolved breakpoint" and in the gdb-console I see, that the break is set to the preprocessed source which is wrong. Is it possible to set the breakpoints on the right source?
We are using CICS on AIX. With the xldb-Debugger and the CDCN-command of CICS we manage that debugging is started, when we come in our programs. Is it possible to get that remotely (in plink) with gdb-eclipse as well?
I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot. It seems from looking at:
http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F
...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:
ssh remotehost gdb
instead of using TM which uses gdbserver. This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).
There's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:
http://wiki.eclipse.org/DSDP/TM/TCF_FAQ
tried also to remotly debug an aix-appl with windows eclipse-cdt-gdb.
Got blocked at the end with unix/windows path-problems. Maybe my result can help u a little further - maybe you already got it work. I'm interested in your comment. asked on eclipse news portal- following the answer of martin oberhuber (thanks again) tried dsp dd (also blocked with path problem) and set an request in eclipse bugzilla.
here the link to news:
http://www.eclipse.org/newsportal/article.php?id=406&group=eclipse.dsdp.tm
Here my bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252758
At the moment we still debug localy with xldb but I am trying ddd-gdb at the moment. At least locally gdb is running.