Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

c - Can I explicitly dump processor cache content to a file?

For some reason, I'd like to know the content of processor caches at arbitrary point of my C program. Is there anyway I can write contents in the cache to a file?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

C doesn't know anything about your processor, its type, or its cache, or anything other related to that.

If you want to access this data, you would need OS-level functionality that supports it (which could potentially be callable from C). You need to look at your OS, and potential other choices, to find out if they support it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...