Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors compiling ministrace #5

Open
aax68 opened this issue Apr 16, 2015 · 1 comment
Open

errors compiling ministrace #5

aax68 opened this issue Apr 16, 2015 · 1 comment

Comments

@aax68
Copy link

aax68 commented Apr 16, 2015

I had fun reading you blog about ministrace. I tried to compile it but end up with errors.

Could you take a look please?

root@oracle1 ministrace]# make
./gen_tables.py /usr/src/linux/
Traceback (most recent call last):
File "./gen_tables.py", line 109, in ?
sys.exit(main(sys.argv[1:]))
File "./gen_tables.py", line 104, in main
syscall_numbers = do_syscall_numbers(os.path.join(linux_dir, unistd_h))
File "./gen_tables.py", line 9, in do_syscall_numbers
for line in open(unistd_h):
IOError: [Errno 2] No such file or directory: '/usr/src/linux/arch/x86/include/asm/unistd_64.h'
make: *** [syscallents.h] Error 1
[root@oracle1 ministrace]# uname -a
Linux xxxxxxxxxxx 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@oracle1 ministrace]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

if it helps, this is what I have for unistd on the system

/usr/include/unistd.h
/usr/include/asm/unistd.h
/usr/include/asm-i386/unistd.h
/usr/include/asm-x86_64/unistd.h
/usr/include/bits/unistd.h
/usr/include/linux/unistd.h
/usr/include/sys/unistd.h
/usr/lib/bcc/include/unistd.h
/usr/lib/bcc/include/bsd/unistd.h
/usr/lib/syslinux/com32/include/unistd.h
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/asm/unistd.ph
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/asm-i386/unistd.ph
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/asm-x86_64/unistd.ph
/usr/share/man/man0p/unistd.h.0p.gz
/usr/src/kernels/2.6.18-308.el5-x86_64/include/asm-i386/unistd.h
/usr/src/kernels/2.6.18-308.el5-x86_64/include/asm-x86_64/ia32_unistd.h
/usr/src/kernels/2.6.18-308.el5-x86_64/include/asm-x86_64/unistd.h
/usr/src/kernels/2.6.18-308.el5-x86_64/include/linux/unistd.h

Thank you

@ceneblock
Copy link

ceneblock commented Apr 26, 2016

You need to modify the python file.

def main(args):
    if not args:
        print >>sys.stderr, "Usage: %s /path/to/linux-2.6" % (sys.argv[0],)
        return 1
    linux_dir = args[0]
    if os.uname()[4] == 'x86_64':
        unistd_h = "asm/unistd_64.h"
    else:
        unistd_h = "asm/unistd_32.h"
 
    syscall_numbers = do_syscall_numbers(os.path.join(linux_dir, unistd_h))
    syscall_types   = find_args(linux_dir)
    write_output('syscallents.h', syscall_types, syscall_numbers)

Please note that python is white space sensitive

Finally, change LINUX_SRC= in the Makefile to /usr/include

I think in your case, you should change asm/unistd_64.h to asm-x86_64/unistd.h in the Python file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants