You are not logged in.

#1 2012-05-07 01:42:42

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 193
Website

[SOLVED] Where to find function definition in Linux kernel?

Hi all,

I'm looking at the Linux kernel source, and in sound/pci/hda/hda_codec.c around line 4119 there is a call to a function called "trace_hda_power_down".  I can't find where this function is defined though.  Does anyone know?  I've tried grepping the entire source tree but this function isn't mentioned anywhere else.  I am able to compile the code without errors, so it must be defined somewhere, but I can't see where!

Last edited by Malvineous (2012-05-07 03:48:02)

Offline

#2 2012-05-07 02:41:25

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED] Where to find function definition in Linux kernel?

Wow, I agree, that's a tricky one!

I noticed it's surrounded by a "CONFIG_SND_HDA_POWER_SAVE" conditional. Do you have "CONFIG_SND_HDA_POWER_SAVE" set to "Y" in your kernel configuration?

Offline

#3 2012-05-07 02:46:25

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 193
Website

Re: [SOLVED] Where to find function definition in Linux kernel?

Yes, it's definitely defined. (The problem I am investigating is related to power saving happening when it shouldn't.)  There are a bunch of other trace_* functions too which also don't seem to be defined, but I can't find any documentation about what they're for or why they seem to compile when they apparently haven't been declared!  They must be declared within a macro somewhere...

Offline

#4 2012-05-07 03:29:14

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Where to find function definition in Linux kernel?

Any function prefixed with 'trace' is generated code as part of the trace subsystem. You won't find an exact definition for it, because it's just a macro: see the hda_codec.h include in the same directory.

Offline

#5 2012-05-07 03:47:46

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 193
Website

Re: [SOLVED] Where to find function definition in Linux kernel?

Ah right, it looks like they're defined in hda_trace.h.  Now to hunt for docs on the trace subsystem...  Thanks both for your help!

Offline

Board footer

Powered by FluxBB