惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园_首页
爱范儿
爱范儿
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
Y
Y Combinator Blog
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
月光博客
月光博客
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans

hwchiu learning note Blog

Kubernetes 怎麼計算 imageFS | hwchiu learning note Nginx Proxy_Pass 不會重新查詢 DNS | hwchiu learning note Multus 下如何透過 network policy 設定 | hwchiu learning note Linux Bridge MTU | hwchiu learning note Kubevirt 初體驗 | hwchiu learning note [MacOS ]隨手筆記 Sed 與 Rename 的使用 | hwchiu learning note Docusaurus 使用 blog mode 後連結一直反白的問題 | hwchiu learning note gcloud 切換帳號 | hwchiu learning note k8s 內安裝 redis-cluster | hwchiu learning note Helm Chart 中如何根據條件來動態安裝 Template 內的物件 | hwchiu learning note GCS 操作上注意事項 | hwchiu learning note istio 操作記錄 | hwchiu learning note terraform | hwchiu learning note Kubernetes GKE 維運上小筆記 | hwchiu learning note Git 修改 author/committer | hwchiu learning note GCP NAT 相關筆記 | hwchiu learning note gcloud ssh 到 GCP VM | hwchiu learning note CloudSQL 收費注意事項 | hwchiu learning note Loki 安裝上的參數調整以及 Ring 的問題除錯 | hwchiu learning note kustomize + helm | hwchiu learning note 觀測 K8s 內 OOM 事件 | hwchiu learning note GKE 上的 RBAC 筆記 | hwchiu learning note 本地產生 jwt token | hwchiu learning note ArgoCD 安裝筆記 | hwchiu learning note CircleCI Context 的使用 | hwchiu learning note 透過 GCP IAP Gateway 來保護 GKE 內的網站 | hwchiu learning note 閱讀筆記: 「SRE 的工作介绍」 | hwchiu learning note 閱讀筆記: 「DevOps is a failure」 | hwchiu learning note 閱讀筆記: 「面試人生 - 設計一個簡易的分散式 Job Scheduler」 | hwchiu learning note 閱讀筆記: 「Cloudflare 06/21 災後報告」 | hwchiu learning note
cscope 使用筆記 | hwchiu learning note
2013-10-05 · via hwchiu learning note Blog

Introducion

Cscope 是一個用來trace code還滿方便的工具 我通常都用他來trace linuxe kernel code,雖然說有網頁版的reference可以使用,但是用起來不順手,網頁會卡卡的 因此還是習慣使用這種互動式的trace tools

Install

sudo apt-get install cscope on Ubuntu

portmaster devel/cscope on FreeBSd

Usage

詳細的可以參考man page. 通常我只有使用 -R 來觀看而已

第一次執行的時候,會花比較久的時間去建立一個cscope.out的檔案,會把一些相關資訊放進去

下次執行的時候就會利用該out檔案來作查詢。

其他

預設的情況下,cscope只能讀取

  • .c
  • .h
  • .l
  • .y

想要讓他讀取java或是cpp的專案,就必須要先自己建置該資料庫

  • find ./ -name *.cpp > cscope.files
  • fine ./ -name *.java >> cscope.files
  • cscope -bkq

前面兩行會把所有的檔案路徑都寫入倒cscope.files裡面

  • b:建立索引文件
  • k:建立索引文件時不會去搜尋/usr/local/目錄
  • q:生成cscope.out,加速索引,該檔案包含
    • locate functions
    • function calls
    • macros
    • variables
    • preprocessor symbols

接下來只要使用cscope就可以了