Profiling c progrma line by line

S

SSG

Hello everybody!
can anyone tell me how to profile the c program using Gprof by line
by line. I am not using a function.

If i declare any function, it work , but without function it couldnt
work

By
S.S.G
 
W

Walter Roberson

can anyone tell me how to profile the c program using Gprof by line
by line. I am not using a function.

Profiling and tools such as Gprof are not part of Standard C.
We would recommend that you ask in a newsgroup more specific to
your OS and tools. There are gnu newsgroups.

If i declare any function, it work , but without function it couldnt
work

If you are using Gprof, the implication is that you are using
a "hosted" implementation rather than an "embedded" implementation.

When you are using a "hosted" environment, the entry point of the
program is -defined- to be the function named 'main'. If you have
not declared any functions, then you have not declared 'main' and
so the OS is not going to have the defined entry point to call,
so there is no certainty that *any* of your code would be executed.

There really isn't much you can do without main() -- initializers
of static (or extern) structures are restricted to be essentially
constants, and you wouldn't be able to call any I/O routines to
examine the initialized memory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top