Huh, i just tried this and to me it works as it should, afaik. Enviroment is ubuntu 13.04 (with gcc 4.7.3).
If it still does not work for you, you might want to check out that the debug symbols are otherwise fine, with say gdb.
% gcc test.c -g -o test
XXX@YYY
% perf record ./test
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.060 MB perf.data (~2620 samples) ]
XXX@YYY
% perf report --stdio
# ========
# captured on: Wed Oct 16 11:58:40 2013
# hostname : sundberg-office-antec
# os release : 3.8.0-31-generic
# perf version : 3.8.13.8
# arch : x86_64
# nrcpus online : 2
# nrcpus avail : 2
# cpudesc : AMD Phenom(tm) II X2 555 Processor
# cpuid : AuthenticAMD,16,4,3
# total memory : 16434276 kB
# cmdline : /usr/bin/perf_3.8.0-31 record ./test
# event : name = cycles, type = 0, config = 0x0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern = 0, excl_host = 0, excl_guest = 1, precise_ip = 0, id = { 671, 672 }
# HEADER_CPU_TOPOLOGY info available, use -I to display
# HEADER_NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: cpu = 4, software = 1, tracepoint = 2, ibs_fetch = 6, ibs_op = 7, breakpoint = 5
# ========
#
# Samples: 1K of event 'cycles'
# Event count (approx.): 1071717616
#
# Overhead Command Shared Object Symbol
# ........ ....... ................. .........................
#
99.85% test test [.] longa
0.08% test [kernel.kallsyms] [k] call_timer_fn
0.08% test [kernel.kallsyms] [k] task_work_run
0.00% test [kernel.kallsyms] [k] clear_page_c
0.00% test [kernel.kallsyms] [k] native_write_msr_safe
#
# (For a higher level overview, try: perf report --sort comm,dso)
#