summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2007-09-24 18:16:16 +0000
committerfche <fche>2007-09-24 18:16:16 +0000
commitda64b256d828a33ff5c3bd78b11aad3705056019 (patch)
tree9c50226dbe4c63b29ee1395327d4f07a05ca16ba
parentb8037bcbc882bad9bf1749c1272a8d927c6972a1 (diff)
downloadsystemtap-steved-da64b256d828a33ff5c3bd78b11aad3705056019.tar.gz
systemtap-steved-da64b256d828a33ff5c3bd78b11aad3705056019.tar.xz
systemtap-steved-da64b256d828a33ff5c3bd78b11aad3705056019.zip
Add /* pure */ to embedded-C functions.
-rw-r--r--tapset/ChangeLog5
-rw-r--r--tapset/inet_sock.stp4
-rw-r--r--tapset/ioblock.stp16
-rw-r--r--tapset/rpc.stp20
-rw-r--r--tapset/scsi.stp4
-rw-r--r--tapset/socket.stp18
-rw-r--r--tapset/tcp.stp10
7 files changed, 39 insertions, 38 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog
index 1f8cd767..34610a67 100644
--- a/tapset/ChangeLog
+++ b/tapset/ChangeLog
@@ -9,6 +9,11 @@
2007-09-24 Frank Ch. Eigler <fche@elastic.org>
+ * inet_sock.stp, ioblock.stp, rpc.stp, scsi.stp, socket.stp,
+ tcp.stp: Add /* pure */ to embedded-C functions.
+
+2007-09-24 Frank Ch. Eigler <fche@elastic.org>
+
* conversions.stp (user_string): Redefine in terms of user_string2.
2007-09-23 Ulrich Drepper <drepper@redhat.com>
diff --git a/tapset/inet_sock.stp b/tapset/inet_sock.stp
index b3daeb68..59ce7fea 100644
--- a/tapset/inet_sock.stp
+++ b/tapset/inet_sock.stp
@@ -24,7 +24,7 @@
// Get local port number
function inet_get_local_port:long(sock:long)
-%{
+%{ /* pure */
struct inet_sock *inet = (struct inet_sock *) (long) THIS->sock;
THIS->__retvalue = kread(&(LPORT));
CATCH_DEREF_FAULT();
@@ -32,7 +32,7 @@ function inet_get_local_port:long(sock:long)
// Get IP source address string
function inet_get_ip_source:string(sock:long)
-%{
+%{ /* pure */
struct inet_sock *inet = (struct inet_sock *) (long) THIS->sock;
union { __u32 d; unsigned char addr[4]; } u;
u.d = kread(DADDR);
diff --git a/tapset/ioblock.stp b/tapset/ioblock.stp
index d2efd525..94781c04 100644
--- a/tapset/ioblock.stp
+++ b/tapset/ioblock.stp
@@ -14,7 +14,7 @@
/* get i-node number of mapped file */
function __bio_ino:long(bio:long)
-%{
+%{ /* pure */
struct bio *bio = (struct bio *)(long)THIS->bio;
struct page *bv_page = bio? kread(&(bio->bi_io_vec[0].bv_page)) : NULL;
struct address_space *mapping;
@@ -33,7 +33,7 @@ function __bio_ino:long(bio:long)
/* returns 0 for read, 1 for write */
function bio_rw_num:long(rw:long)
-%{
+%{ /* pure */
long rw = (long)THIS->rw;
THIS->__retvalue = (rw & (1 << BIO_RW));
%}
@@ -46,7 +46,7 @@ function bio_rw_str(rw)
/* returns start sector */
function __bio_start_sect:long(bio:long)
-%{
+%{ /* pure */
struct bio *bio = (struct bio *)(long)THIS->bio;
struct block_device *bi_bdev = bio? kread(&(bio->bi_bdev)) : NULL;
struct hd_struct *bd_part = bi_bdev? kread(&(bi_bdev->bd_part)) : NULL;
@@ -59,7 +59,7 @@ function __bio_start_sect:long(bio:long)
/* returns the block device name */
function __bio_devname:string(bio:long)
-%{
+%{ /* pure */
char b[BDEVNAME_SIZE];
struct bio *bio = (struct bio *)(long)THIS->bio;
struct block_device *bdev = kread(&(bio->bi_bdev));
@@ -72,12 +72,8 @@ function __bio_devname:string(bio:long)
CATCH_DEREF_FAULT();
%}
-global BIO_READ, BIO_WRITE
-probe begin
-{
- BIO_READ = 0
- BIO_WRITE = 1
-}
+global BIO_READ = 0, BIO_WRITE = 1
+
/* probe ioblock.request
*
diff --git a/tapset/rpc.stp b/tapset/rpc.stp
index cf411ed5..29a8e0fa 100644
--- a/tapset/rpc.stp
+++ b/tapset/rpc.stp
@@ -838,7 +838,7 @@ probe sunrpc.sched.delay.return = kernel.function("rpc_delay").return ?,
*****************************************************************/
function xid_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
if (clnt == NULL)
THIS->__retvalue = 0;
@@ -850,7 +850,7 @@ function xid_from_clnt:long(clnt:long)
%}
function prog_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
if (clnt == NULL)
THIS->__retvalue = 0;
@@ -866,7 +866,7 @@ function prog_from_clnt:long(clnt:long)
%}
function vers_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
if (clnt == NULL)
THIS->__retvalue = 0;
@@ -882,7 +882,7 @@ function vers_from_clnt:long(clnt:long)
%}
function prot_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
if (clnt == NULL)
THIS->__retvalue = 0;
@@ -894,7 +894,7 @@ function prot_from_clnt:long(clnt:long)
%}
function port_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
struct rpc_xprt *cl_xprt = clnt? kread(&(clnt->cl_xprt)) : NULL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
@@ -914,19 +914,19 @@ function port_from_clnt:long(clnt:long)
%}
function clones_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
THIS->__retvalue = atomic_read(&clnt->cl_count); /* FIXME: deref hazard! */
%}
function tasks_from_clnt:long(clnt:long)
-%{
+%{ /* pure */
struct rpc_clnt *clnt = (struct rpc_clnt *)(long)THIS->clnt;
THIS->__retvalue = atomic_read(&clnt->cl_users); /* FIXME: deref hazard! */
%}
function proc_from_msg:long(msg:long)
-%{
+%{ /* pure */
struct rpc_message *msg = (struct rpc_message *)(long)THIS->msg;
if (msg == NULL)
THIS->__retvalue = 0;
@@ -938,7 +938,7 @@ function proc_from_msg:long(msg:long)
%}
function vers_from_prog:long(program:long, vers:long)
-%{
+%{ /* pure */
struct rpc_program *program = (struct rpc_program *)(long)THIS->program;
if (program && THIS->vers < kread(&(program->nrvers))) {
struct rpc_version **version_array = kread(&(program->version));
@@ -950,7 +950,7 @@ function vers_from_prog:long(program:long, vers:long)
%}
function addr_from_rqst:long(rqstp:long)
-%{
+%{ /* pure */
struct svc_rqst *rqstp = (struct svc_rqst *)(long)THIS->rqstp;
if (rqstp) {
diff --git a/tapset/scsi.stp b/tapset/scsi.stp
index 10993ee7..c9103cd6 100644
--- a/tapset/scsi.stp
+++ b/tapset/scsi.stp
@@ -80,13 +80,13 @@ probe scsi.iocompleted
}
function scsi_timer_pending:long(var:long)
-%{
+%{ /* pure */
struct scsi_cmnd *cmd = (struct scsi_cmnd *)((long)THIS->var);
THIS->__retvalue = timer_pending(&cmd->eh_timeout); /* FIXME: deref hazard! */
%}
function get_devstate_from_req:long(var:long)
-%{
+%{ /* pure */
struct request_queue *q = (struct request_queue *)((long)THIS->var);
struct scsi_device *sdev = (struct scsi_device *)kread(&(q->queuedata));
THIS->__retvalue = kread(&(sdev->sdev_state));
diff --git a/tapset/socket.stp b/tapset/socket.stp
index 00199665..563b866b 100644
--- a/tapset/socket.stp
+++ b/tapset/socket.stp
@@ -625,7 +625,7 @@ function sock_type_str2num:long (type:string)
######### SOCKET FLAGS HELPER FUNCTIONS #########
function sock_flags_num2str:string (flags:long)
-%{
+%{ /* pure */
#ifndef SOCK_PASSSEC
#define SOCK_PASSSEC 4 /* introduced in 2.6.18 */
#endif
@@ -650,7 +650,7 @@ function sock_flags_num2str:string (flags:long)
######### MESSAGE FLAGS HELPER FUNCTIONS #########
function msg_flags_num2str:string (flags:long)
-%{
+%{ /* pure */
char str[256];
str[0] = '\0';
@@ -891,7 +891,7 @@ function _success_check(ret:long)
}
function _get_sock_addr:long (file:long)
-%{
+%{ /* pure */
struct file *filep = (struct file *)(long)(THIS->file);
struct socket *sockp = filep? kread(&(filep->private_data)) : NULL;
if (sockp == NULL)
@@ -902,7 +902,7 @@ function _get_sock_addr:long (file:long)
%}
function _get_sock_size:long (iov:long, nr_segs:long)
-%{
+%{ /* pure */
struct iovec *iovp = (struct iovec *)(long)(THIS->iov);
if (iovp == NULL)
THIS->__retvalue = -1;
@@ -916,7 +916,7 @@ function _get_sock_size:long (iov:long, nr_segs:long)
%}
function _sock_prot_num:long (sock:long)
-%{
+%{ /* pure */
struct socket *sktp = (struct socket *)(long)(THIS->sock);
struct sock *skp = sktp? kread(&(sktp->sk)) : NULL;
if (skp == NULL)
@@ -927,7 +927,7 @@ function _sock_prot_num:long (sock:long)
%}
function _sock_fam_num:long (sock:long)
-%{
+%{ /* pure */
struct socket *sockp = (struct socket *)(long)(THIS->sock);
const struct proto_ops *ops = sockp? kread(&(sockp->ops)) : NULL;
if (ops == NULL)
@@ -938,7 +938,7 @@ function _sock_fam_num:long (sock:long)
%}
function _sock_state_num:long (sock:long)
-%{
+%{ /* pure */
struct socket *sockp = (struct socket *)(long)(THIS->sock);
if (sockp == NULL)
THIS->__retvalue = -1;
@@ -948,7 +948,7 @@ function _sock_state_num:long (sock:long)
%}
function _sock_type_num:long (sock:long)
-%{
+%{ /* pure */
struct socket *sockp = (struct socket *)(long)(THIS->sock);
if (sockp == NULL)
THIS->__retvalue = -1;
@@ -958,7 +958,7 @@ function _sock_type_num:long (sock:long)
%}
function _sock_flags_num:long (sock:long)
-%{
+%{ /* pure */
struct socket *sockp = (struct socket *)(long)(THIS->sock);
if (sockp == NULL)
THIS->__retvalue = -1;
diff --git a/tapset/tcp.stp b/tapset/tcp.stp
index 82fee190..1357e587 100644
--- a/tapset/tcp.stp
+++ b/tapset/tcp.stp
@@ -20,7 +20,7 @@
// retransmit. It should always be less than the max value of TCP retransmission
// timeout (TCP_RTO_MAX)
function tcp_get_info_rto:long(sock:long)
-%{
+%{ /* pure */
struct sock *sk = (struct sock *)(long) THIS->sock;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
struct tcp_opt *tp = tcp_sk(sk);
@@ -37,7 +37,7 @@ function tcp_get_info_rto:long(sock:long)
//This congestion window size can be dynamically increased based on whether TCP
//is performing slow start or congestion avoidance.
function tcp_get_info_snd_cwnd:long(sock:long)
-%{
+%{ /* pure */
struct sock *sk = (struct sock *)(long) THIS->sock;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
struct tcp_opt *tp = tcp_sk(sk);
@@ -65,7 +65,7 @@ function tcp_get_info_snd_cwnd:long(sock:long)
// TCP_MAX_STATES = 12 Max states number
//
function tcp_ts_get_info_state:long(sock:long)
-%{
+%{ /* pure */
struct sock *sk = (struct sock *)(long) THIS->sock;
THIS->__retvalue = (int64_t) kread(&(sk->sk_state));
CATCH_DEREF_FAULT();
@@ -79,7 +79,7 @@ function tcp_sockstate_str:string (state:long) {
// threshold size, then TCP is in slow start; otherwise TCP is in congestion
// avoidance.
function tcp_ts_get_info_snd_ssthresh:long(sock:long)
-%{
+%{ /* pure */
struct sock *sk = (struct sock *)(long) THIS->sock;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
struct tcp_opt *tp = tcp_sk(sk);
@@ -93,7 +93,7 @@ function tcp_ts_get_info_snd_ssthresh:long(sock:long)
// Get receiver's advertised segment size. TCP typically never sends more
// than what receiver can accept.
function tcp_ts_get_info_rcv_mss:long(sock:long)
-%{
+%{ /* pure */
struct sock *sk = (struct sock *)(long) THIS->sock;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
struct tcp_opt *tp = tcp_sk(sk);