Skip to content

Commit 95500a8

Browse files
committed
/home/fox/release/dtrace/dtrace-20110612.tar.bz2
1 parent 1d30037 commit 95500a8

6 files changed

Lines changed: 63 additions & 20 deletions

File tree

.release

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
date=Sat Jun 11 14:55:21 BST 2011
2-
release=dtrace-20110611
3-
build=271
1+
date=Sun Jun 12 22:15:36 BST 2011
2+
release=dtrace-20110612
3+
build=273

Changes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Sun Jun 12 00:01:13 2011 fox
2+
3+
512* mkport.pl, dtrace_isa.c: Handle dump_trace() specially with
4+
respect to number of args.
5+
6+
511* driver/sdt_linux.c: Fix stupid issue in io::: probe on
7+
AS4 (2.6.9 kernels).
8+
19
Sat Jun 11 14:52:06 2011 fox
210

311
510* archive: 1.0123

driver/dtrace_isa.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes,
157157
g_pcstack = pcstack;
158158
g_pcstack_limit = pcstack_limit;
159159

160-
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)
161-
dump_trace(NULL, NULL, NULL, &print_trace_ops, NULL);
162-
#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 37)
160+
#if FUNC_DUMP_TRACE_ARGS == 6
163161
dump_trace(NULL, NULL, NULL, 0, &print_trace_ops, NULL);
164162
#else
165163
dump_trace(NULL, NULL, NULL, &print_trace_ops, NULL);

driver/dwarf.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,8 @@ do_dwarf_phdr(char *ptr, dw_info_t *dw)
374374
int found = 0;
375375
char *fp_start;
376376
char *fp;
377+
unsigned addr;
378+
int fde_count;
377379
int do_phdr = 1;
378380

379381
/***********************************************/
@@ -445,9 +447,9 @@ printk("do_dwarf_phdr: %d ehdr=%p eh_frame_hdr_data=%p fp=%p\n", __LINE__, ehdr,
445447
printf("EH.fde_fount_enc: %02x\n", *fp++);
446448
printf("EH.table_enc: %02x\n", *fp++);
447449
printf("EH.eh_frame_ptr: %02x\n", *(uint32_t *) fp); fp += 4;
448-
int fde_count = *(uint32_t *) fp; fp += 4;
450+
fde_count = *(uint32_t *) fp; fp += 4;
449451
printf("EH.fde_count: %02x\n", fde_count);
450-
unsigned addr = 0;
452+
addr = 0;
451453
for (i = 0; i < fde_count; i++) {
452454
char *fp1 = fp + i * 2 * 4;
453455
unsigned addr1 = *(uint32_t *) (fp1 + 4);
@@ -524,7 +526,7 @@ dw_find_ret_addr(dw_info_t *dw, unsigned long pc, int *cfa_offsetp)
524526

525527
char *aug = NULL;
526528

527-
printk("dw_find_ret_addr: here....1\npc=%p fp=%p end=%p size=%x\n", pc, fp, eh_frame_end, dw->eh_frame_sec->sh_size);
529+
printk("dw_find_ret_addr: here....1\npc=%p fp=%p end=%p size=%x\n", (void *) pc, fp, eh_frame_end, (int) dw->eh_frame_sec->sh_size);
528530
/***********************************************/
529531
/* Walk the series of CIE/FDE entries til */
530532
/* we find one that matches the target */
@@ -613,8 +615,8 @@ printf("R encoding %x (kernel)\n", *a);
613615
}
614616

615617
printf("\n%04x FDE len=%x cie=%04x pc=%lx..%lx tpc=%lx\n",
616-
fp_start - dw->eh_frame_data - 4,
617-
len, cie,
618+
(int) (fp_start - dw->eh_frame_data - 4),
619+
(int) len, (int) cie,
618620
dw->pc_begin, dw->pc_begin + dw->pc_end, pc);
619621
//printf("fde_encoding=%d\n", fde_encoding);
620622
if (*aug == 'z') {
@@ -833,7 +835,7 @@ return 1;
833835
/* Nope - not here at all. */
834836
/***********************************************/
835837
printf("not found at all....\n");
836-
printk("here....1 fp=%p end=%p size=%x\n", fp, eh_frame_end, dw->eh_frame_sec->sh_size);
838+
printk("here....1 fp=%p end=%p size=%x\n", fp, eh_frame_end, (int) dw->eh_frame_sec->sh_size);
837839
return 0;
838840
}
839841
static char *

driver/sdt_linux.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/* the kernel code directly. (This is still supported - sort of). */
55
/* */
66
/* Author: Paul D. Fox */
7-
/* $Header: Last edited: 28-Jul-2010 1.1 $ */
7+
/* $Header: Last edited: 11-Jun-2011 1.2 $ */
88
/**********************************************************************/
99

1010
/*
@@ -235,7 +235,7 @@ static char buf2[1024];
235235
static char buf3[1024];
236236
char *name;
237237
char *fname;
238-
char *mntname;
238+
char *mntname = NULL;
239239

240240
memset(&finfo, 0, sizeof finfo);
241241
finfo.f.fi_offset = offset;
@@ -245,19 +245,24 @@ static char buf3[1024];
245245
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
246246
fname = d_path(&file->f_path, buf, sizeof buf);
247247
#else
248-
fname = d_path(&file->f_dentry, file->f_vfsmnt, buf, sizeof buf);
248+
fname = d_path(file->f_dentry, file->f_vfsmnt, buf, sizeof buf);
249249
#endif
250+
if (IS_ERR(fname)) {
251+
fname = "(unknown)";
252+
}
250253
name = strrchr(fname, '/');
251254
memcpy(buf2, "<unknown>", 10);
252255
if (fname && name) {
253256
memcpy(buf2, fname, name - fname);
254257
buf2[name - fname] = '\0';
255258
}
259+
256260
/***********************************************/
257261
/* Problem with older (2.6.9 kernel). */
258262
/***********************************************/
259-
if (dentry_path_fn)
263+
if (dentry_path_fn) {
260264
mntname = dentry_path_fn(file->f_vfsmnt->mnt_mountpoint, buf3, sizeof buf3);
265+
}
261266

262267
finfo.f.fi_dirname = buf2;
263268
finfo.f.fi_name = name ? name + 1 : "<none>";
@@ -274,7 +279,7 @@ static char buf3[1024];
274279
finfo.d.dev_instance = file->f_mapping->host->i_rdev;
275280
}
276281

277-
finfo.d.dev_pathname = file->f_vfsmnt->mnt_devname;
282+
finfo.d.dev_pathname = (char *) file->f_vfsmnt->mnt_devname;
278283
finfo.d.dev_statname = mntname;
279284

280285
return &finfo;

tools/mkport.pl

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/perl
22

3-
# $Header: Last edited: 17-Jan-2011 1.2 $
3+
# $Header: Last edited: 12-Jun-2011 1.3 $
44
#
55
# Script to poke around the kernel to see what files or structs are
66
# available that we really want. Usually there in a later kernel, but
@@ -24,6 +24,8 @@
2424
my $kern;
2525
my $kern_src;
2626

27+
my $username = getpwuid(getuid());
28+
2729
#######################################################################
2830
# Command line switches. #
2931
#######################################################################
@@ -124,6 +126,7 @@ sub main
124126
if (have("stacktrace_ops", "include/asm/stacktrace.h") ||
125127
have("stacktrace_ops", "arch/x86/include/asm/stacktrace.h")) {
126128
$inc .= "# define HAVE_STACKTRACE_OPS \n";
129+
$inc .= find_dump_trace_args();
127130
}
128131

129132
###############################################
@@ -193,11 +196,16 @@ sub main
193196
######################################################################
194197
sub check_lex_yytext
195198
{
196-
my $fh = new FileHandle(">/tmp/$ENV{USER}-lex.l");
199+
my $fh = new FileHandle(">/tmp/$username-lex.l");
200+
if (!$fh) {
201+
print "Cannot create /tmp/$username-lex.l -- $!\n";
202+
print "Please check the permissions on the file.\n";
203+
exit(1);
204+
}
197205
print $fh "%%\n";
198206
print $fh "%%\n";
199207
$fh->close();
200-
system("cd /tmp ; lex /tmp/$ENV{USER}-lex.l");
208+
system("cd /tmp ; lex /tmp/$username-lex.l");
201209

202210
$fh = new FileHandle("/tmp/lex.yy.c");
203211
if (!$fh) {
@@ -220,6 +228,28 @@ sub check_lex_yytext
220228
return $ret;
221229
}
222230
######################################################################
231+
# The dump_trace() function for dumping a stack via callbacks has #
232+
# either 5 or 6 arguments, but what it has is not dependent on #
233+
# the X.Y.Z kernel release, so we need to handle this #
234+
# dynamically. #
235+
######################################################################
236+
sub find_dump_trace_args
237+
{
238+
my $fh = new FileHandle("$kern/arch/x86/include/asm/stacktrace.h");
239+
return "" if !$fh;
240+
while (<$fh>) {
241+
next if !/^void\s+dump_trace/;
242+
my $str = $_;
243+
while (<$fh>) {
244+
$str .= $_;
245+
last if /\);/;
246+
}
247+
$str =~ s/[^,]//g;
248+
return "# define FUNC_DUMP_TRACE_ARGS " . (length($str) + 1) . "\n";
249+
}
250+
return "";
251+
}
252+
######################################################################
223253
# Grep a file to see if something is where we want it. #
224254
######################################################################
225255
sub have

0 commit comments

Comments
 (0)