On Thu, Mar 5, 2015 at 10:36 PM, Malek Musleh <malek.mus...@gmail.com>
wrote:

> Which flags does --trace incorporate?
>

None.


> Or in otherwords, where is the printfs coming from:
>

https://chromium.googlesource.com/v8/v8/+/master/src/runtime/runtime-test.cc#386


> I don't see trace as an option on the d8 help list,
>

I do:
$ out/ia32.release/d8 --help | grep -- "--trace "
  --trace (trace function calls)

but it does work:
>
> I see the function name "test" being printed out: (e.g.)
>
>    1: ~+51(this=0x24e1a20144b9 <JS Global Object>) {
>
> and the output of the function and its type as well: <String[2]: aa>
>

Yup, that's what it does.


> My goal in with this is to determine the number of times a function for a
> given set of arguments is called, and so if I can see where these traces
> are being printed, I can maintain my own data structure in the same
> location.
>

I would think that processing the raw log with an external script is
easier, but that's obviously up to you... If you're only interested in one
(or a few) specific function(s), even easier than that would be putting
counters directly into its/their source.


> program:
>
> function test( obj ) {
>     return obj.prop + obj.prop;
> }
>
> var a = { prop: 'a' }, i = 0;
>
> while ( i++ < 10000 ) {
>     test( a );
> }
>
> output:
>
>    1: ~+27(this=0x24e1a2005009 <JS Global Object>) {
>    2:  ~ExtendStringPrototype+23(this=0x3d090ae04121 <undefined>) {
>    2:  } -> 0x3d090ae04121 <undefined>
>    1: } -> 0x3d090ae04121 <undefined>
>    1: ~+27(this=0x24e1a2005009 <JS Global Object>) {
>    2:  ~ExtendStringForTemplates+23(this=0x3d090ae04121 <undefined>) {
>    2:  } -> 0x3d090ae04121 <undefined>
>    1: } -> 0x3d090ae04121 <undefined>
>    1: ~+27(this=0x24e1a20144b9 <JS Global Object>) {
>    2:  ~ExtendStringPrototype+23(this=0x3d090ae04121 <undefined>) {
>    2:  } -> 0x3d090ae04121 <undefined>
>    1: } -> 0x3d090ae04121 <undefined>
>    1: ~+27(this=0x24e1a20144b9 <JS Global Object>) {
>    2:  ~ExtendStringForTemplates+23(this=0x3d090ae04121 <undefined>) {
>    2:  } -> 0x3d090ae04121 <undefined>
>    1: } -> 0x3d090ae04121 <undefined>
>    1: ~+51(this=0x24e1a20144b9 <JS Global Object>) {
>    2:  ~test+47(this=0x24e1a20144b9 <JS Global Object>, 0x24e1a2022469 <an
> Object with map 0x3c6abe514231>) {
>    2:  } -> 0x24e1a20225b1 <String[2]: aa>
>    2:  ~test+47(this=0x24e1a20144b9 <JS Global Object>, 0x24e1a2022469 <an
> Object with map 0x3c6abe
>
>
> On Wednesday, March 4, 2015 at 2:47:37 PM UTC-5, Jakob Kummerow wrote:
>>
>> Try  --trace.
>>
>> On Wed, Mar 4, 2015 at 8:12 PM, Malek Musleh <malek....@gmail.com> wrote:
>>
>>> Hi,
>>>
>>>
>>> I want to be able trace / record a programs call to its functions (name
>>> + argument values) either as a separate analysis pass or in addition to an
>>> existing one (which ever is easier). I see that  there is an an api   for
>>> printing/formatting the stack trace: prepareStackTrace in src/messages.js
>>> but that is only called on internal errors.
>>>
>>> I think I shold be trying to call prepareStackTrace in order to get the
>>> information I want, I am just not sure in which passes/source file would be
>>> the best place to do so.
>>>
>>>
>>> Thanks,
>>>
>>> Malek
>>>
>>> --
>>> --
>>> v8-users mailing list
>>> v8-u...@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to v8-users+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to