Rafael Vanoni
2009-Feb-13 20:18 UTC
[dtrace-discuss] key #1 is incompatible with prototype
Running into a strange error with powertop(1). The script below, which worked until snv_107, fails with the following error rvp at catfish:~$ dtrace -s /tmp/freq.d dtrace: failed to compile script /tmp/freq.d: line 13: last[ ] key #1 is incompatible with prototype: prototype: int key: struct vsd_node rvp at catfish:~$ cat /tmp/freq.d hrtime_t last[int]; BEGIN { begin = timestamp; } :::cpu-change-speed /last[((cpudrv_devstate_t *)arg0)->cpu_id] != 0/ { this->cpu = ((cpudrv_devstate_t *)arg0)->cpu_id; this->oldspeed = ((cpudrv_pm_t *)arg1)->cur_spd->speed; @times[this->cpu, this->oldspeed] = sum(timestamp - last[this->cpu]); last[this->cpu] = timestamp; } :::cpu-change-speed /last[((cpudrv_devstate_t *)arg0)->cpu_id] == 0/ { this->cpu = ((cpudrv_devstate_t *)arg0)->cpu_id; this->oldspeed = ((cpudrv_pm_t *)arg1)->cur_spd->speed; @times[this->cpu, this->oldspeed] = sum(timestamp - begin); last[this->cpu] = timestamp; } If I replace hrtime_t last[int]; with something like hrtime_t last[2]; I get rvp at catfish:~$ dtrace -s /tmp/freq.d dtrace: failed to compile script /tmp/freq.d: line 13: operands have incompatible types: "hrtime_t [2]" + "struct vsd_node" Line 13 being @times[this->cpu, this->oldspeed] = sum(timestamp - last[this->cpu]); Any ideas ? Thanks, Rafael
Adam Leventhal
2009-Feb-16 03:20 UTC
[dtrace-discuss] key #1 is incompatible with prototype
Hi Rafael, What bits are you trying this on? I suggest you try to whittle this script down to the smallest version you can that reproduces a similar failure. From there, we can help diagnose the problem. Adam On Feb 13, 2009, at 12:18 PM, Rafael Vanoni wrote:> Running into a strange error with powertop(1). The script below, > which worked until snv_107, fails with the following error > > rvp at catfish:~$ dtrace -s /tmp/freq.d > dtrace: failed to compile script /tmp/freq.d: line 13: last[ ] key > #1 is incompatible with prototype: > prototype: int > key: struct vsd_node > > rvp at catfish:~$ cat /tmp/freq.d > hrtime_t last[int]; > > BEGIN > { > begin = timestamp; > } > > :::cpu-change-speed > /last[((cpudrv_devstate_t *)arg0)->cpu_id] != 0/ > { > this->cpu = ((cpudrv_devstate_t *)arg0)->cpu_id; > this->oldspeed = ((cpudrv_pm_t *)arg1)->cur_spd->speed; > @times[this->cpu, this->oldspeed] = sum(timestamp - last[this->cpu]); > last[this->cpu] = timestamp; > } > :::cpu-change-speed > /last[((cpudrv_devstate_t *)arg0)->cpu_id] == 0/ > { > this->cpu = ((cpudrv_devstate_t *)arg0)->cpu_id; > this->oldspeed = ((cpudrv_pm_t *)arg1)->cur_spd->speed; > @times[this->cpu, this->oldspeed] = sum(timestamp - begin); > last[this->cpu] = timestamp; > } > > > If I replace > > hrtime_t last[int]; > > with something like > > hrtime_t last[2]; > > I get > > rvp at catfish:~$ dtrace -s /tmp/freq.d > dtrace: failed to compile script /tmp/freq.d: line 13: operands have > incompatible types: "hrtime_t [2]" + "struct vsd_node" > > Line 13 being > > @times[this->cpu, this->oldspeed] = sum(timestamp - last[this->cpu]); > > > Any ideas ? > > Thanks, > Rafael > > > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Rafael Vanoni
2009-Feb-16 19:10 UTC
[dtrace-discuss] key #1 is incompatible with prototype
Adam Leventhal wrote:> Hi Rafael, > > What bits are you trying this on? I suggest you try to whittle this > script down to the smallest version you can that reproduces a similar > failure. From there, we can help diagnose the problem. > > AdamHi Adam Here''s a simpler example. I''m running OpenSolaris snv_107 on x86. rvp at catfish:/sandbox/tmp$ pfexec dtrace -n ''cpu-change-speed{printf("%d\n", ((cpudrv_devstate_t *)arg0)->cpu_id)}'' dtrace: invalid probe specifier cpu-change-speed{printf("%d\n", ((cpudrv_devstate_t *)arg0)->cpu_id)}: printf( ) argument #2 is incompatible with conversion #1 prototype: conversion: %d prototype: char, short, int, long, or long long argument: struct vsd_node I filed 6805610 to track this issue. Rafael
Hi Rafael, Works fine for me :-) . I''ll pick up 6805610 and work this offline with you. Jon.> Here''s a simpler example. I''m running OpenSolaris snv_107 on x86. > > rvp at catfish:/sandbox/tmp$ pfexec dtrace -n > ''cpu-change-speed{printf("%d\n", > ((cpudrv_devstate_t *)arg0)->cpu_id)}'' > dtrace: invalid probe specifier cpu-change-speed{printf("%d\n", > ((cpudrv_devstate_t *)arg0)->cpu_id)}: printf( ) argument #2 is > incompatible > with conversion #1 prototype: > conversion: %d > prototype: char, short, int, long, or long long > argument: struct vsd_node > > I filed 6805610 to track this issue. > > Rafael > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org