Skip to contentSkip to conversation

kprobes for 2.5.73 with single-stepping out-of-line

PATCH Andi Kleen 2 participants 4 messages Jun 24, 2003 – Jun 25, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
Quoted 1 line · Vamsi Krishna S .

+static struct kprobe *current_kprobe;

This global variable is quite unclean. It looks like it is for passing function arguments around. Why is it needed?

Review

Quoted 4 lines
(quoted diff) +4 -0
+#define KPROBE_HASH_BITS 6
+#define KPROBE_TABLE_SIZE (1 << KPROBE_HASH_BITS)
+
+static struct list_head kprobe_table[KPROBE_TABLE_SIZE];

Use hlists?

-Andi

#2 lore raw
Quoted 8 lines · Andi Kleen
Quoted 1 line · Vamsi Krishna S .

+static struct kprobe *current_kprobe;

This global variable is quite unclean. It looks like it is for passing function arguments around. Why is it needed?

This is used for keeping track of the probe that is currently being handled. This information is needed to be kept across a trap 3 - singlestep - trap 1. So, we set store the current probe in this variable while handling trap 3, for use while handling the subsequent trap 1.

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+#define KPROBE_HASH_BITS 6
+#define KPROBE_TABLE_SIZE (1 << KPROBE_HASH_BITS)
+
+static struct list_head kprobe_table[KPROBE_TABLE_SIZE];

Use hlists?

Yes, that will save some space in this hash table.. will convert to hlists and repost.

Quoted 2 lines

-Andi

Thanks,
Vamsi.

Signature · 4 lines
Vamsi Krishna S.
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: [email protected]
author
#3 lore raw
Quoted 6 lines · Vamsi Krishna S .
Quoted 5 lines · Andi Kleen
Quoted 1 line · Vamsi Krishna S .

+static struct kprobe *current_kprobe;

Quoted 8 lines
Quoted 3 lines

This global variable is quite unclean. It looks like it is for passing function arguments around. Why is it needed?

This is used for keeping track of the probe that is currently being handled. This information is needed to be kept across a trap 3 - singlestep - trap 1. So, we set store the current probe in this variable while handling trap 3, for use while handling the subsequent trap 1.

But how can this be SMP safe? Do you hold a lock during all this?

-Andi

#4 lore raw
Quoted 10 lines · Andi Kleen
Quoted 9 lines · Vamsi Krishna S .
Quoted 8 lines · Andi Kleen
Quoted 1 line · Vamsi Krishna S .

+static struct kprobe *current_kprobe;

This global variable is quite unclean. It looks like it is for passing function arguments around. Why is it needed?

Quoted 8 lines
Quoted 5 lines

This is used for keeping track of the probe that is currently being handled. This information is needed to be kept across a trap 3 - singlestep - trap 1. So, we set store the current probe in this variable while handling trap 3, for use while handling the subsequent trap 1.

But how can this be SMP safe? Do you hold a lock during all this?

Yes.. in the interests of keeping the locking to a minimum, only one probe can be handled at a time, even on SMP.

Quoted 1 line

-Andi

Thanks,
Vamsi.

Signature · 4 lines
Vamsi Krishna S.
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: [email protected]