Tracing a function with jprobes

One problem with kprobes is that you can’t check validity of the arguments passed to the function you are monitoring. For that matter, jprobes comes in. It’s basically make a wrapper for the existing function and will be called instead without make any changes to the existing function. jprobes is an extention to the kprobesContinue reading “Tracing a function with jprobes”

Tracing an instruction or a function with kprobes

As the kernel is running on top of all other services, it’s hard to debug it in a live system. You can use ‘gdb’ on a live system, but you only can check the current values of some exported symbols. You can’t use breakpoint on a running kernel. If you set a breakpoint, it’ll stopContinue reading “Tracing an instruction or a function with kprobes”

Extending SysRq

Basics about SysRq During the kernel debugging, you can use SysRq to get some details about the system status at some point or to execute some commands without typing the command. We can use one of the below method to trigger the operation. Method 1. $ echo 1 > /proc/sys/kernel/sysrq Press ‘Alt-SysRq-[key]’ combination to triggerContinue reading “Extending SysRq”

How to build a module with source codes in separate directories.

If you want to use separate directories for source files and target modules, you can use below scheme. mod_main.c #include #include MODULE_LICENSE(“GPL”); static int __init mod_entry(void) { return 0; } static void __exit mod_exit(void) { return; } module_init(mod_entry); module_exit(mod_exit); sub_mod.c #include #include int sub_func(int i) { printk(“Hello %d”, i); return 0; } EXPORT_SYMBOL(sub_func); MakefileContinue reading “How to build a module with source codes in separate directories.”

Using single-tap and double-tap in the same view

If you are going to use two similar gestures in a view, it could cause the problem. For example, in the following code snippet, I tried to use single tap for changing screen mode while double tap is used to toggle bookmark flag. [self.svContent addGestureRecognizer:toggleFavoriteTap]; [self.svContent addGestureRecognizer:toggleFullScreenTap]; But, there’s one problem with this. When youContinue reading “Using single-tap and double-tap in the same view”

Do you need a UI that used in twitter for iPad?

Twitter for iPad’s UI is so great. It uses very efficient and elegant method to show hierarchical information. If you want to implement this in your app, there’s a good news. Check the following screen. Isn’t look similar to the twitter’s interface? You can download source code from here: It’s still need some improvementContinue reading “Do you need a UI that used in twitter for iPad?”

Use TabBar and Navigation Controller at the same time

Interface Builder is a great tool to minimize your typing and make you see the output before you compile it. But, sometimes, it blocks you to implement your thought clearly. Combining TabBar and NavigationBar is one of those cases. If you want to use TabBar, you easily can make it using Interface Builder, but InterfaceContinue reading “Use TabBar and Navigation Controller at the same time”

Registers which are using when passing function arguments on x86_64

Brief notes for me which registers are used when passing function arguments on x86_64: %rdi – 1st argument (%rdi:64, %edi:32, %di:16, %dl:8) %rsi – 2nd argument (%rsi:64, %esi:32, %si:16, %sl:8) %rdx – 3rd argument (%rdx:64, %edx:32, %dx:16, %dl:8) %rcx – 4th argument (%rcx:64, %ecx:32, %cx:16, %cl:8) %r8 – 5th argument (%r8:64, %r8d:32, %r8w:16, %r8b:8) %r9Continue reading “Registers which are using when passing function arguments on x86_64”