<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/markup_oops.pl, branch v4.14</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-05-14T02:20:44Z</updated>
<entry>
<title>scripts: Switch to more portable Perl shebang</title>
<updated>2017-05-14T02:20:44Z</updated>
<author>
<name>Kamil Rytarowski</name>
<email>n54@gmx.com</email>
</author>
<published>2017-05-07T21:25:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cb77f0d623ff33a7899cb945f4f5a4825fbb2ea1'/>
<id>urn:sha1:cb77f0d623ff33a7899cb945f4f5a4825fbb2ea1</id>
<content type='text'>
The default NetBSD package manager is pkgsrc and it installs Perl
along other third party programs under custom and configurable prefix.
The default prefix for binary prebuilt packages is /usr/pkg, and the
Perl executable lands in /usr/pkg/bin/perl.

This change switches "/usr/bin/perl" to "/usr/bin/env perl" as it's
the most portable solution that should work for almost everybody.
Perl's executable is detected automatically.

This change switches -w option passed to the executable with more
modern "use warnings;" approach. There is no functional change to the
default behavior.

While there, drop "require 5" from scripts/namespace.pl (Perl from 1994?).

Signed-off-by: Kamil Rytarowski &lt;n54@gmx.com&gt;
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
</content>
</entry>
<entry>
<title>kbuild: Make scripts executable</title>
<updated>2014-08-20T14:03:45Z</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2014-08-20T14:02:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=06ed5c2bfacaf67039e87a213fa5d1cdde34246a'/>
<id>urn:sha1:06ed5c2bfacaf67039e87a213fa5d1cdde34246a</id>
<content type='text'>
The Makefiles call the respective interpreter explicitly, but this makes
it easier to use the scripts manually.

Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>kbuild: trivial - remove trailing empty lines</title>
<updated>2014-06-09T22:04:06Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.m@jp.panasonic.com</email>
</author>
<published>2014-05-29T05:12:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7eb6e340526adf14ed7cf7dfde8b9c6fc0741cfc'/>
<id>urn:sha1:7eb6e340526adf14ed7cf7dfde8b9c6fc0741cfc</id>
<content type='text'>
Signed-off-by: Masahiro Yamada &lt;yamada.m@jp.panasonic.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-35' of git://repo.or.cz/linux-kbuild</title>
<updated>2010-06-01T15:55:52Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-06-01T15:55:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1f73897861b8ef0be64ff4b801f8d6f830f683b5'/>
<id>urn:sha1:1f73897861b8ef0be64ff4b801f8d6f830f683b5</id>
<content type='text'>
* 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits)
  kbuild: Revert part of e8d400a to resolve a conflict
  kbuild: Fix checking of scm-identifier variable
  gconfig: add support to show hidden options that have prompts
  menuconfig: add support to show hidden options which have prompts
  gconfig: remove show_debug option
  gconfig: remove dbg_print_ptype() and dbg_print_stype()
  kconfig: fix zconfdump()
  kconfig: some small fixes
  add random binaries to .gitignore
  kbuild: Include gen_initramfs_list.sh and the file list in the .d file
  kconfig: recalc symbol value before showing search results
  .gitignore: ignore *.lzo files
  headerdep: perlcritic warning
  scripts/Makefile.lib: Align the output of LZO
  kbuild: Generate modules.builtin in make modules_install
  Revert "kbuild: specify absolute paths for cscope"
  kbuild: Do not unnecessarily regenerate modules.builtin
  headers_install: use local file handles
  headers_check: fix perl warnings
  export_report: fix perl warnings
  ...
</content>
</entry>
<entry>
<title>markup_oops.pl: minor fixes</title>
<updated>2010-02-05T21:33:43Z</updated>
<author>
<name>Hui Zhu</name>
<email>hui.zhu@windriver.com</email>
</author>
<published>2010-02-01T05:41:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=59dde3853e07aaadc2b63abd16c954d5b0606cf1'/>
<id>urn:sha1:59dde3853e07aaadc2b63abd16c954d5b0606cf1</id>
<content type='text'>
1. Fix a little format issue.
2. Check the return of "Getopt::Long::GetOptions".  Output usage and
   exit if it get error.
3. Change $ARGV[$#ARGV] to $ARGV[0].
4. Change the code which get $modulefile from modinfo.  Replace the
   pipeline with `modinfo -F filename $module`.
4. Change usage from "Specify the module directory name" to "Specify the
   module filename".

Signed-off-by: Hui Zhu &lt;teawater@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>markup_oops.pl: add options to improve cross-sompilation environments</title>
<updated>2010-02-05T21:32:23Z</updated>
<author>
<name>Hui Zhu</name>
<email>hui.zhu@windriver.com</email>
</author>
<published>2010-01-26T09:13:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=52e13e219d5930fb8fb774050e6ecffa244a60a9'/>
<id>urn:sha1:52e13e219d5930fb8fb774050e6ecffa244a60a9</id>
<content type='text'>
The markup_oops.pl have 3 troubles to support cross-compiler environment:
1.  It use objdump directly.
2.  It use modinfo to get the message of module.
3.  It use hex function that cannot support 64-bit number in 32-bit arch.

This patch add 3 options to markup_oops.pl:
1. -c CROSS_COMPILE	Specify the prefix used for toolchain.
2. -m MODULE_DIRNAME	Specify the module directory name.
3. Change hex function to Math::BigInt-&gt;from_hex.

After this patch, parse the x8664 oops in x86, we can:
cat amd64m | perl ~/kernel/tmp/m.pl -c /home/teawater/kernel/bin/x8664- -m ./e.ko vmlinux

Thanks,
Hui

Signed-off-by: Hui Zhu &lt;teawater@gmail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: ozan@pardus.org.tr
Cc: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Acked-by: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>markup_oops.pl: fix $func_offset error with x86_64</title>
<updated>2010-02-03T02:11:22Z</updated>
<author>
<name>Hui Zhu</name>
<email>teawater@gmail.com</email>
</author>
<published>2010-02-02T21:44:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef2b9b054580ef835078d8aa411bd06542cd5c1c'/>
<id>urn:sha1:ef2b9b054580ef835078d8aa411bd06542cd5c1c</id>
<content type='text'>
When I use markup_oops.pl parse a x8664 oops, I got:

objdump: --start-address: bad number: NaN
No matching code found
This is because:
main::(./m.pl:228):	open(FILE, "objdump -dS --adjust-vma=$vmaoffset --start-address=$decodestart --stop-address=$decodestop $filename |") || die "Cannot start objdump";
  DB&lt;3&gt; p $decodestart
NaN

This NaN is from:
main::(./m.pl:176):	my $decodestart = Math::BigInt-&gt;from_hex("0x$target") - Math::BigInt-&gt;from_hex("0x$func_offset");
  DB&lt;2&gt; p $func_offset
0x175

There is already a "0x" in $func_offset, another 0x makes it a NaN.

The $func_offset is from line:

	if ($line =~ /RIP: 0010:\[\&lt;[0-9a-f]+\&gt;\]  \[\&lt;[0-9a-f]+\&gt;\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) {
		$function = $1;
		$func_offset = $2;
	}

I make a patch to change "(0x[0-9a-f]+)\/0x[a-f0-9]/)" to "0x([0-9a-f]+)\/0x[a-f0-9]/)".

Signed-off-by: Hui Zhu &lt;teawater@gmail.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>markup_oops.pl: fix for faulting instruction in the first line of a range</title>
<updated>2010-02-02T13:33:56Z</updated>
<author>
<name>Hui Zhu</name>
<email>hui.zhu@windriver.com</email>
</author>
<published>2010-01-28T06:58:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0139f1d9539395ca341e17060ae26f44f5f31434'/>
<id>urn:sha1:0139f1d9539395ca341e17060ae26f44f5f31434</id>
<content type='text'>
I got a "No matching code found" when I use markup_oops.pl parse a error
in a x86_64 module.

cat e.c

int init_module(void)
{
	char	*buf = 0;

	buf[0] = 3;

	return 0;
}

void cleanup_module(void)
{
	//char	*buf = 0;

	//buf[0] = 3;
}

MODULE_AUTHOR("Hui Zhu");
MODULE_LICENSE("GPL");

0000000000000000 &lt;init_module&gt;:
init_module():
/home/teawater/study/kernel/stack2core/example/e.c:10
   0:	c6 04 25 00 00 00 00 	movb   $0x3,0x0
   7:	03
/home/teawater/study/kernel/stack2core/example/e.c:13
   8:	31 c0                	xor    %eax,%eax
   a:	c3                   	retq
   b:	0f 1f 44 00 00       	nopl   0x0(%rax,%rax,1)

0000000000000010 &lt;cleanup_module&gt;:
cleanup_module():
/home/teawater/study/kernel/stack2core/example/e.c:20
  10:	f3 c3                	repz retq
  12:	90                   	nop
  13:	90                   	nop
Disassembly of section .modinfo:

This is because the faulting instruction "movb   $0x3,0x0" is the first
line of the range.

In the markup_oops.pl:
main::(./scripts/markup_oops.pl:245):
245:				if (InRange($1, $target)) {
  DB&lt;2&gt; p $line
ffffffffa001b000:	c6 04 25 00 00 00 00 	movb   $0x3,0x0
  DB&lt;3&gt; p $counter
0

It just set $center in next loop. So it cannot get the $center.

And even if $center is set to the right value 0.
if ($center == 0) {
	print "No matching code found \n";
	exit;
}
The first line $center will be 0, so I change the default value to -1.

Signed-off-by: Hui Zhu &lt;teawater@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
</entry>
<entry>
<title>markup_oops.pl: fix error with x86</title>
<updated>2010-01-16T20:15:37Z</updated>
<author>
<name>Hui Zhu</name>
<email>teawater@gmail.com</email>
</author>
<published>2010-01-16T01:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1f8cdae43929d32e3706c314eb2a302dc3683fba'/>
<id>urn:sha1:1f8cdae43929d32e3706c314eb2a302dc3683fba</id>
<content type='text'>
When I try to use markup_oops.pl in x86, I always get:

cat 1 | perl markup_oops.pl ./vmlinux
objdump: --start-address: bad number: NaN
No matching code found

This is because in line:
	if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+0x([0-9a-f]+)\/[a-f0-9]/) {
 		$function = $1;
 		$func_offset = $2;
 	}

$func_offset will get a number like "0x2"

But in follow code:

my $decodestart = Math::BigInt-&gt;from_hex("0x$target") -
Math::BigInt-&gt;from_hex("0x$func_offset");

It add other ox to ox2.  Then this value will be set to NaN.

So I made a small patch to fix it.

Signed-off-by: Hui Zhu &lt;teawater@gmail.com&gt;
Acked-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>markup_oops: use modinfo to avoid confusion with underscored module names</title>
<updated>2009-09-20T10:27:43Z</updated>
<author>
<name>Ozan Çaglayan</name>
<email>ozan@pardus.org.tr</email>
</author>
<published>2009-09-18T19:49:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=82fa39552fd858468a5647fa58d14955ecd50eb4'/>
<id>urn:sha1:82fa39552fd858468a5647fa58d14955ecd50eb4</id>
<content type='text'>
When EIP is at a module having an underscore in its name, the current code
fails to find it because the module filenames has '-' instead of '_'.  Use
modinfo for a better path finding.

Signed-off-by: Ozan Çaglayan &lt;ozan@pardus.org.tr&gt;
Acked-by: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
</content>
</entry>
</feed>
