Vasanth Bhat
2010-Dec-27 11:35 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Hi, Is there a escape charater to escape the appeareance of special characters like ''%'' appearing as a part of probemode or probefunc. For example, I the following sample d-trace script which fails to compile because of the special character ''%''.This is part of the libraryname ( /usr/lib/iconv/646%8859.so ) pid1061:646*%*8859.so::entry { printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); } When tried to run it fails with error "dtrace: failed to compile script /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" I tried using "\" to escape "%". But that didn''t help. How we handle such cases? Also, on an another note, how do we obtain the fullpath of the library inside a d-script. The "probemod" by default retuurns the module name without the path. (libxyz.so) Thanks Vasanth -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20101227/e45a6bfe/attachment.html>
Adam Leventhal
2010-Dec-27 20:38 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Hey Vasanth, You might try something like this: pid1061:646?8859.so::entry { ... } You might then his a problem in the pid provider itself; let me know and we can work from there. Adam On Mon, Dec 27, 2010 at 6:35 AM, Vasanth Bhat <vasanth at sun.com> wrote:> Hi, > > ????? Is there a escape charater to escape the appeareance of special > characters like ''%'' ? appearing as a part of probemode or probefunc. > > For example,? I? the following? sample d-trace script which fails to compile > because of? the special character ''%''.This is part of the libraryname ( > /usr/lib/iconv/646%8859.so ) > > pid1061:646%8859.so::entry > { > ? printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); > } > > When tried to run it fails with error "dtrace: failed to compile script > /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" > > I tried using "\" to escape "%". But that didn''t help.? How we handle such > cases? > > Also, on an another note, how do we obtain the? fullpath of the library > inside a d-script.? The "probemod"?? by default retuurns the module name > without the path. (libxyz.so) > > Thanks > Vasanth > > > > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >-- Adam Leventhal, Delphix ? ? ? ? ? ? ? ? ? ? ? ?http://dtrace.org/blogs/ahl
vasanth
2010-Dec-28 08:52 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Thanks Adam. That works. Does this means the probe will match for not just "646%8859.so", but also for other module, like "646x8859.so" or "646a8859.so" etc. Do I need to have the additional check for the specific module in the predicate ( /probemod == "646%8859.so"/ ) Thanks Vasanth> Hey Vasanth, > > You might try something like this: > > pid1061:646?8859.so::entry > { > ... > } > > You might then his a problem in the pid provider itself; let me know > and we can work from there. > > Adam > > On Mon, Dec 27, 2010 at 6:35 AM, Vasanth Bhat <vasanth at sun.com> wrote: > >> Hi, >> >> Is there a escape charater to escape the appeareance of special >> characters like ''%'' appearing as a part of probemode or probefunc. >> >> For example, I the following sample d-trace script which fails to compile >> because of the special character ''%''.This is part of the libraryname ( >> /usr/lib/iconv/646%8859.so ) >> >> pid1061:646%8859.so::entry >> { >> printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); >> } >> >> When tried to run it fails with error "dtrace: failed to compile script >> /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" >> >> I tried using "\" to escape "%". But that didn''t help. How we handle such >> cases? >> >> Also, on an another note, how do we obtain the fullpath of the library >> inside a d-script. The "probemod" by default retuurns the module name >> without the path. (libxyz.so) >> >> Thanks >> Vasanth >> >> >> >> >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org >> >> > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20101228/607905e7/attachment.html>
Adam Leventhal
2010-Dec-28 21:35 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Hey Vasanth, Correct; I should have mentioned that use of the globbing character means that you could match other modules. As you say, using a predicate will protect you against erroneous matches. Adam On Dec 28, 2010, at 3:52 AM, vasanth wrote:> Thanks Adam. > > That works. > > Does this means the probe will match for not just "646%8859.so", but also for other module, like "646x8859.so" or "646a8859.so" etc. Do I need to have the additional check for the specific module in the predicate ( /probemod == "646%8859.so"/ ) > > Thanks > Vasanth > >> Hey Vasanth, >> >> You might try something like this: >> >> pid1061:646?8859.so::entry >> { >> ... >> } >> >> You might then his a problem in the pid provider itself; let me know >> and we can work from there. >> >> Adam >> >> On Mon, Dec 27, 2010 at 6:35 AM, Vasanth Bhat >> <vasanth at sun.com> >> wrote: >> >> >>> Hi, >>> >>> Is there a escape charater to escape the appeareance of special >>> characters like ''%'' appearing as a part of probemode or probefunc. >>> >>> For example, I the following sample d-trace script which fails to compile >>> because of the special character ''%''.This is part of the libraryname ( >>> /usr/lib/iconv/646%8859.so ) >>> >>> pid1061:646%8859.so::entry >>> { >>> printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); >>> } >>> >>> When tried to run it fails with error "dtrace: failed to compile script >>> /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" >>> >>> I tried using "\" to escape "%". But that didn''t help. How we handle such >>> cases? >>> >>> Also, on an another note, how do we obtain the fullpath of the library >>> inside a d-script. The "probemod" by default retuurns the module name >>> without the path. (libxyz.so) >>> >>> Thanks >>> Vasanth >>> >>> >>> >>> >>> _______________________________________________ >>> dtrace-discuss mailing list >>> >>> dtrace-discuss at opensolaris.org >>> >>> >>> >>> >> >> >> >> >> >-- Adam Leventhal, Delphix http://dtrace.org/blogs/ahl -- Adam Leventhal, Delphix http://dtrace.org/blogs/ahl
vasanth
2010-Dec-29 08:37 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Thanks Adam. Is there known list of other special characters which needs to be handled this way. Thanks Vasanth> Hey Vasanth, > > Correct; I should have mentioned that use of the globbing character means that you could match other modules. As you say, using a predicate will protect you against erroneous matches. > > Adam > > On Dec 28, 2010, at 3:52 AM, vasanth wrote: > > >> Thanks Adam. >> >> That works. >> >> Does this means the probe will match for not just "646%8859.so", but also for other module, like "646x8859.so" or "646a8859.so" etc. Do I need to have the additional check for the specific module in the predicate ( /probemod == "646%8859.so"/ ) >> >> Thanks >> Vasanth >> >> >>> Hey Vasanth, >>> >>> You might try something like this: >>> >>> pid1061:646?8859.so::entry >>> { >>> ... >>> } >>> >>> You might then his a problem in the pid provider itself; let me know >>> and we can work from there. >>> >>> Adam >>> >>> On Mon, Dec 27, 2010 at 6:35 AM, Vasanth Bhat >>> <vasanth at sun.com> >>> wrote: >>> >>> >>> >>>> Hi, >>>> >>>> Is there a escape charater to escape the appeareance of special >>>> characters like ''%'' appearing as a part of probemode or probefunc. >>>> >>>> For example, I the following sample d-trace script which fails to compile >>>> because of the special character ''%''.This is part of the libraryname ( >>>> /usr/lib/iconv/646%8859.so ) >>>> >>>> pid1061:646%8859.so::entry >>>> { >>>> printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); >>>> } >>>> >>>> When tried to run it fails with error "dtrace: failed to compile script >>>> /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" >>>> >>>> I tried using "\" to escape "%". But that didn''t help. How we handle such >>>> cases? >>>> >>>> Also, on an another note, how do we obtain the fullpath of the library >>>> inside a d-script. The "probemod" by default retuurns the module name >>>> without the path. (libxyz.so) >>>> >>>> Thanks >>>> Vasanth >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> dtrace-discuss mailing list >>>> >>>> dtrace-discuss at opensolaris.org >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20101229/166c19f7/attachment.html>
Adam Leventhal
2010-Dec-29 13:38 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Hi Vasanth, You can find it in the libdtrace parser: ??http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/common/dt_lex.l#69 RGX_PSPEC [-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`?*\\\[\]!]* That''s an initial -$:a-zA-Z_.?*\[]! and then after that those same characters plus 0-9 and `. Adam On Wed, Dec 29, 2010 at 3:37 AM, vasanth <vasanth at sun.com> wrote:> > Thanks Adam. > > Is there? known list of other? special characters which needs to be handled this way. > > Thanks > Vasanth > > Hey Vasanth, > > Correct; I should have mentioned that use of the globbing character means that you could match other modules. As you say, using a predicate will protect you against erroneous matches. > > Adam > > On Dec 28, 2010, at 3:52 AM, vasanth wrote: > > > > Thanks Adam. > > That works. > > Does this means the probe will match for not just "646%8859.so", but also for other module, like "646x8859.so" or "646a8859.so" etc. Do I need to have the additional check for the specific module in the predicate ( /probemod == "646%8859.so"/ ) > > Thanks > Vasanth > > > > Hey Vasanth, > > You might try something like this: > > pid1061:646?8859.so::entry > { > ... > } > > You might then his a problem in the pid provider itself; let me know > and we can work from there. > > Adam > > On Mon, Dec 27, 2010 at 6:35 AM, Vasanth Bhat > <vasanth at sun.com> > wrote: > > > > > Hi, > > Is there a escape charater to escape the appeareance of special > characters like ''%'' appearing as a part of probemode or probefunc. > > For example, I the following sample d-trace script which fails to compile > because of the special character ''%''.This is part of the libraryname ( > /usr/lib/iconv/646%8859.so ) > > pid1061:646%8859.so::entry > { > printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); > } > > When tried to run it fails with error "dtrace: failed to compile script > /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" > > I tried using "\" to escape "%". But that didn''t help. How we handle such > cases? > > Also, on an another note, how do we obtain the fullpath of the library > inside a d-script. The "probemod" by default retuurns the module name > without the path. (libxyz.so) > > Thanks > Vasanth > > > > > _______________________________________________ > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > > > > > > > > > >-- Adam Leventhal, Delphix ? ? ? ? ? ? ? ? ? ? ? ?http://dtrace.org/blogs/ahl
vasanth
2010-Dec-30 09:23 UTC
[dtrace-discuss] Escaping Special Characters in probe description and fullpath of module
Thanks Adam. --Vasanth> Hi Vasanth, > > You can find it in the libdtrace parser: > http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/common/dt_lex.l#69 > > RGX_PSPEC [-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`?*\\\[\]!]* > > That''s an initial -$:a-zA-Z_.?*\[]! and then after that those same > characters plus 0-9 and `. > > Adam > > On Wed, Dec 29, 2010 at 3:37 AM, vasanth <vasanth at sun.com> wrote: > >> Thanks Adam. >> >> Is there known list of other special characters which needs to be handled this way. >> >> Thanks >> Vasanth >> >> Hey Vasanth, >> >> Correct; I should have mentioned that use of the globbing character means that you could match other modules. As you say, using a predicate will protect you against erroneous matches. >> >> Adam >> >> On Dec 28, 2010, at 3:52 AM, vasanth wrote: >> >> >> >> Thanks Adam. >> >> That works. >> >> Does this means the probe will match for not just "646%8859.so", but also for other module, like "646x8859.so" or "646a8859.so" etc. Do I need to have the additional check for the specific module in the predicate ( /probemod == "646%8859.so"/ ) >> >> Thanks >> Vasanth >> >> >> >> Hey Vasanth, >> >> You might try something like this: >> >> pid1061:646?8859.so::entry >> { >> ... >> } >> >> You might then his a problem in the pid provider itself; let me know >> and we can work from there. >> >> Adam >> >> On Mon, Dec 27, 2010 at 6:35 AM, Vasanth Bhat >> <vasanth at sun.com> >> wrote: >> >> >> >> >> Hi, >> >> Is there a escape charater to escape the appeareance of special >> characters like ''%'' appearing as a part of probemode or probefunc. >> >> For example, I the following sample d-trace script which fails to compile >> because of the special character ''%''.This is part of the libraryname ( >> /usr/lib/iconv/646%8859.so ) >> >> pid1061:646%8859.so::entry >> { >> printf("%s|%d|%s|%s\n",execname,pid,probemod,probefunc); >> } >> >> When tried to run it fails with error "dtrace: failed to compile script >> /tmp/d-scripts/runscan_1061.d: line 8: syntax error near "%" >> >> I tried using "\" to escape "%". But that didn''t help. How we handle such >> cases? >> >> Also, on an another note, how do we obtain the fullpath of the library >> inside a d-script. The "probemod" by default retuurns the module name >> without the path. (libxyz.so) >> >> Thanks >> Vasanth >> >> >> >> >> _______________________________________________ >> dtrace-discuss mailing list >> >> dtrace-discuss at opensolaris.org >> >> >> >> >> >> >> >> >> >> >> >> > > > > -- > Adam Leventhal, Delphix http://dtrace.org/blogs/ahl >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20101230/ef0cbe23/attachment.html>