summaryrefslogtreecommitdiffstats
path: root/tapset/conversions.stp
diff options
context:
space:
mode:
authorhunt <hunt>2006-07-04 10:06:21 +0000
committerhunt <hunt>2006-07-04 10:06:21 +0000
commit4f4a5ea455348a92ea6294fc1bdb32981f9e6c21 (patch)
treefeac23b540b530e9fa01d29a3b3a255e1d866cd7 /tapset/conversions.stp
parentfb77d02e478a871acbb8b82ce7bff8c6979e5821 (diff)
downloadsystemtap-steved-4f4a5ea455348a92ea6294fc1bdb32981f9e6c21.tar.gz
systemtap-steved-4f4a5ea455348a92ea6294fc1bdb32981f9e6c21.tar.xz
systemtap-steved-4f4a5ea455348a92ea6294fc1bdb32981f9e6c21.zip
2006-07-04 Martin Hunt <hunt@redhat.com>
* syscalls.stp, syscalls2.stp: Use user_string_quoted().
Diffstat (limited to 'tapset/conversions.stp')
-rw-r--r--tapset/conversions.stp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tapset/conversions.stp b/tapset/conversions.stp
index 78e936aa..96c7162a 100644
--- a/tapset/conversions.stp
+++ b/tapset/conversions.stp
@@ -49,3 +49,16 @@ function user_string_warn:string (addr:long) %{ /* pure */
strlcpy (THIS->__retvalue, "<unknown>", MAXSTRINGLEN);
}
%}
+
+function user_string_quoted:string (addr:long) %{ /* pure */
+ if (THIS->addr == 0)
+ strlcpy (THIS->__retvalue, "NULL", MAXSTRINGLEN);
+ else {
+ *THIS->__retvalue = '\"';
+ if (_stp_strncpy_from_user (THIS->__retvalue+1,
+ (const char __user*) (uintptr_t) THIS->addr, MAXSTRINGLEN-2) < 0)
+ strlcpy (THIS->__retvalue, "<unknown>", MAXSTRINGLEN);
+ else
+ strlcat(THIS->__retvalue, "\"", MAXSTRINGLEN);
+ }
+%}