Closed tao2years closed 4 years ago
Hi,
You can include the write
callback in your analysis, such as:
this.write = function(iid, name, val){
console.log('write', J$.iidToLocation(iid), name, typeof(val));
}
We have a test analysis including the write callback: https://github.com/Haiyang-Sun/nodeprof.js/blob/master/src/ch.usi.inf.nodeprof/js/analysis/rw/analysis.js
You need to build nodeprof first, and then you can try this analysis with the following cmd in the nodeprof directory:
mx jalangi --analysis src/ch.usi.inf.nodeprof/js/analysis/rw/analysis.js YOURTEST.js
Or in the docker image release, you can run your test by replacing the example analysis with your analysis code:
./bin/node --experimental-options --nodeprof ./nodeprof/nodeprof.js --analysis ./nodeprof/examples/example.js ./nodeprof/tests/helloworld.js
Thanks! I will have a try!
As a newer, I wonder how can I record all operation write of a Node.js program. E.g x = 3