Comments (11)
@honggyukim @Taeung I added --opt-file
option (66c6869).
from uftrace.
This is the feature I was waiting for. One of the main purpose of python scripting was to read system wide stats such as rss, but this can handle it better in some specific cases. I also want to run 'read' trigger at the function exit as you mentioned, so we need to think about the interface.
It may be another issue but I would like to simplify some options and trigger actions. Currently, -A
serves only for arguments, -R
serves only for return values, and -T
is for other triggering options at the entry of function. And -F
can also provide some trigger actions. Sometimes, I have to provide the same function name many times to provides it to each -A
, -R
, -T
, -F
option. We may have to make those simpler way to reduce the repetition.
from uftrace.
One more question is that I'm wondering if maxrss
from rusage
is the same rss information that can be read from /proc/[pid]/stat
. I thought that it's the maximum value.
from uftrace.
@honggyukim , I also thought the spot of bother you said above.
So we need to implement the config feature for it ?
I thought we can make the config feature like menuconfig of linux kernel IMHO,
and if we do, the config feature(TUI) can utilize symbol information from target program,
but I'm not sure it is great way.. hum..
from uftrace.
@honggyukim I agree that repeating names for each option is not a great way. Maybe we can just use -T
and -R
for entry/exit time trigger and provides -F
, -N
and -A
for simpler interface (and compatibility). Thoughts?
from uftrace.
@Taeung I don't know what do you want to do with the config interface. Do you want to specify functions and their triggers in a config file?
from uftrace.
@Taeung It would be great if we can pass a config file for those setup. I mentioned that we could provide options with $(< config)
but it's shell dependent so I prefer to have a config file that contains all the options that we can pass to uftrace. I thought about the structure json like format but it could be anything.
from uftrace.
Some tools provide a way to read options from a file directly. For example, gcc supports @file
option for this.
from uftrace.
@namhyung , Yes, the config interface I said is for a particular target program, not overall.
I thought if we apply the config interface,
the user can temporally set various options (e.g. trigger, event, filter, arguments, etc.)
with given function names on TUI before recording target execution.
Hum.. temporary setup(to prepare various options) before recording a particular target program ?
or,
As @honggyukim said, if we enable the user to pass a config file for those setup,
additionally I thought uftrace tool can generate a skeleton config file for the user.
But they can be needless, if uftrace tool support the way to read options from a file.. as you said.
from uftrace.
Update to review/trigger-read-v2.
Changelog:
- change name to 'proc.statm' to clarify it's reading memory stats from
/proc/self/statm
- add 'proc.page-fault' to show page faults
- fix segfault when more than 4 events before saving to shmbuf
- fix a bug on parsing regex pattern
- drop event after fork()
Example:
$ uftrace -T b@read=proc.statm t-abc
# DURATION TID FUNCTION
[32417] | main() {
[32417] | a() {
[32417] | b() {
[32417] | /* read:proc.statm (size=6810KB, rss=785KB, shared=719KB) */
[32417] | c() {
0.479 us [32417] | getpid();
3.014 us [32417] | } /* c */
16.914 us [32417] | } /* b */
17.083 us [32417] | } /* a */
17.873 us [32417] | } /* main */
$ uftrace -T b@read=proc.page-fault t-abc
# DURATION TID FUNCTION
[32766] | main() {
[32766] | a() {
[32766] | b() {
[32766] | /* read:proc.page-fault (major=0, minor=188) */
[32766] | c() {
0.609 us [32766] | getpid();
13.722 us [32766] | } /* c */
24.950 us [32766] | } /* b */
25.564 us [32766] | } /* a */
26.963 us [32766] | } /* main */
from uftrace.
Update to review/trigger-read-v3.
Changelog:
- rename to "proc/statm" and "page-fault"
- honor color setting
Example:
$ uftrace -T b@read=proc/statm,color=green t-abc
# DURATION TID FUNCTION
0.819 us [17908] | __monstartup();
0.475 us [17908] | __cxa_atexit();
[17908] | main() {
[17908] | a() {
[17908] | b() {
[17908] | /* read:proc/statm (size=6809KB, rss=765KB, shared=701KB) */
[17908] | c() {
0.602 us [17908] | getpid();
2.148 us [17908] | } /* c */
21.077 us [17908] | } /* b */
21.391 us [17908] | } /* a */
21.743 us [17908] | } /* main */
$ uftrace -T b@read=page-fault t-abc
# DURATION TID FUNCTION
1.167 us [31503] | __monstartup();
0.870 us [31503] | __cxa_atexit();
[31503] | main() {
[31503] | a() {
[31503] | b() {
[31503] | /* read:page-fault (major=0, minor=189) */
[31503] | c() {
0.772 us [31503] | getpid();
2.780 us [31503] | } /* c */
8.254 us [31503] | } /* b */
8.661 us [31503] | } /* a */
9.212 us [31503] | } /* main */
from uftrace.
Related Issues (20)
- test: Run test suite on multiple environments HOT 1
- kernel tests failures HOT 1
- cmds: static `tmp_dirname` used stack after return HOT 1
- Give monotonic time offset from real time. HOT 4
- Various runtime issues running numerical simulation HOT 26
- Fix close file descriptor in setup_dwarf_info function to release acquired resource
- Generate uftrace.data in rotation HOT 1
- Add new `hist` command HOT 2
- how to trace a dynamic lib HOT 7
- Build failures with LTO HOT 2
- Segmentation fault with uftrace dump --flame-graph HOT 8
- Typo in README: Redundant 'the' in documentation
- Improve Documentation about Flame Graph (with --sample-time examples) HOT 1
- Compile warning on `โsizeofโ in the earlier argument and not in the later argument` HOT 2
- Compile warning caused by Python3.12 header from `-Wdeclaration-after-statement` HOT 2
- what should i do when i want to trace a member function? HOT 1
- demangling failure with __device_stub_ prefix HOT 5
- "./misc/demangler --unknown" triggers segfault
- How to get uftrace data before the process terminates? HOT 3
- Segmentation fault HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uftrace.