10

I am working on an academic research regarding some very long functions in the Linux kernel (link, link).

For that research, I would like to use some code flow visualization tool, that would be able to plot a graph in which each vertex is a decision point and each edge is a piece of code which runs in a consequent way.

Do you know of any good, open source project that can visualize C code?

5 Answers 5

9
+50

Perhaps a tool like KCacheGrind would be of help. It generates call graphs based on actual calls and cannot pre-generate a call graph without actually running the program, which may not suit your needs, but then it again it may.

KCacheGrind Call Graph

Sign up to request clarification or add additional context in comments.

Comments

1

History flow's are very neat for changes/diff across multiple versions.

Codeplex has a project, Dependency Visualizer which does support C also.

Gprof2Dot can render oprofile, this would get you dynamic info also.

CodeViz also (static tool) would work.

If your using gcc, gcc-xml has an introspector plugin also todo this.

Comments

1

You appears to want to acquire a flowchart of C source code ("decisions", "code blocks").
Something like this C flowchart?

To do this correctly, esp. for Linux kernal code, I'd expect you to have to preprocess the code first to get rid of macros and conditionals. I would assume that GCC would construct such a graph internally and that you ought to be able to get your hands on that graph.

Comments

0

Doxygen does some amount of 'visualization',
but you need to work on the code a bit for it to be usable.


Another interesting thing to check would be lxr

Linux Cross Referencer is a software toolset for indexing and presenting source code repositories. LXR was initially targeted at the Linux source code, but has proved usable for a wide range of software projects. lxr.linux.no is currently running an experimental fork of the LXR software.

Comments

0

I can recommend Sourcetrail. Can work with a compile_commands.json. Not sure if it's still maintained, though. But it's foss and you can fork it!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.