In fact lsmod or cat /proc/modules display the information about the currently running modules only.
In the question: ``how to tell which modules have been built into kernel?'' as I understand it you ask about the features built directly into the kernel. Two above commands inform about loadable runtime modules (not built into the kernel). Features built into the kernel and stored in loadable modules are complementary. So you want the opposite information than provided by those two commands.
If the kernel was built with ``Kernel .config support'' option switched to on you can display the kernel configuration by running the command invoking extract-ikconfig script with the parameter pointing some kernel file, for example:
Code:
cd /usr/src/linux
./scripts/extract-ikconfig /boot/vmlinuz-generic-2.6.27.7
In the output you'll see the features built into kernel (y), compiled as modules (m), and not set:
Code:
#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
# CONFIG_CPU_FREQ_DEBUG is not set
These data are usually stored in provided with kernel's sources /usr/src/linux/.config file.