linux – 如何在搜索过程中使cscope显示完整的文件路径

当我使用cscope搜索C符号或全局定义时,它会显示文件名和行号.我想看到完整的文件路径,以便我可以跳转到我的arch特定文件.例如,在 Linux代码库上的cscope build上搜索__switch_to的全局定义时,我得到:
Global definition: __switch_to

  File         Line
0 process.c    297 struct task_struct *__switch_to(struct task_struct *prev,1 switch_to.h   44 #define __switch_to(prev,next,last) do { \
2 process.c    202 struct task_struct *__switch_to(struct task_struct *old,3 process.c    400 struct task_struct *__switch_to(struct task_struct *prev,4 process_32.c 211 __switch_to(struct task_struct *prev,struct task_struct *next)
5 process.c     80 void *__switch_to(struct task_struct *from,struct task_struct *to)
6 process_32.c 248 __switch_to(struct task_struct *prev_p,struct task_struct *next_p)
7 process_64.c 272 __switch_to(struct task_struct *prev_p,struct task_struct *next_p)

现在,每个arch的文件process.c都不同.如何让cscope显示完整的文件路径?

解决方法

使用args -pn运行cscope

-pn Display the last n file path components instead of the default (1). Use 0 not to display the file name at all.

使用cscope -p4运行并搜索__switch_to的全局定义

Global definition: __switch_to

  File                           Line
0 arch/arm64/kernel/process.c    297 struct task_struct *__switch_to(struct task_struct *prev,1 ia64/include/asm/switch_to.h    44 #define __switch_to(prev,last) do { \
2 arch/openrisc/kernel/process.c 202 struct task_struct *__switch_to(struct task_struct *old,3 arch/powerpc/kernel/process.c  400 struct task_struct *__switch_to(struct task_struct *prev,4 arch/sh/kernel/process_32.c    211 __switch_to(struct task_struct *prev,struct task_struct *next)
5 arch/um/kernel/process.c        80 void *__switch_to(struct task_struct *from,struct task_struct *to)
6 arch/x86/kernel/process_32.c   248 __switch_to(struct task_struct *prev_p,struct task_struct *next_p)
7 arch/x86/kernel/process_64.c   272 __switch_to(struct task_struct *prev_p,struct task_struct *next_p)

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...