2012ǯ05��30��

inotify �� Android ��Υե����� I/O ��ƻ뤹��

¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÅÐÏ¿

���� Android �Υ����������ɤ��ɤ�Ǥ����ޤˡ�����ν����ˤ����ƥ����ƥ���ȯ������ե����� I/O ��ή����ǧ�������Ȼפ��ޤ��������������������İ�������ͭ�Ѥȹͤ�������Ǥ��������� inotify �����Ѥ��뤳�Ȥˤ��ޤ�����

Android �� Linux �����ͥ�ˤ� inotify ���ޤޤ�Ƥ��ꡢAndroid SDK �ˤ� inotify �����Ѥ��� FileObserver ���饹���Ѱդ���Ƥ��ޤ���

Android �Ǥϰ��̤Υ��ץꥱ�������ץ��������饢�������Ǥ���ե����롦�ǥ��쥯�ȥ꤬���¤���뤿�ᡢFileObserver ��Ȥ� Android ���ץ�η��ǥġ�����Ѱդ��Ƥ⺣�����Ū�ˤϤ��ޤ����Ω���ʤ��Ǥ��礦�������������ˤ� CUI �Υ��ޥ�ɥ饤��ġ��������������ͻ�̤������ޤ���Android ���ߥ�졼���Ķ��ؤ� adb shell ��³�������� root ���¤Υ��󥽡����ǥġ����ư�������Ȥˤ��ޤ�����

Android �� notify ���ޥ�ɤ�Ȥ�

Android �ˤ� inotify API ��Ȥäƥե����� I/O ���˥����륳�ޥ�ɥ饤��ġ����notify�פ��ޤޤ�Ƥ��ޤ��� [platform/system/core/toolbox/notify.c]

# notify
Usage: notify [-m eventmask] [-c count] [-p] [-v verbosity] path [path ...]
���� notify ���ޥ�ɤ�Ȥä� "/data/local/tmp" �ǥ��쥯�ȥ��ƻ뤷�Ĥ��̥ץ���������ʲ��Υ��ޥ�ɤ�¹Ԥ������ν�����򼨤��ޤ���
# pwd
/data/local/tmp
# echo aaa > test.txt
# mv test.txt aaa.txt
# notify -c 10 /data/local/tmp
/data/local/tmp: 00000100 00000000 "test.txt"  ; 0x00000100:IN_CREATE
/data/local/tmp: 00000020 00000000 "test.txt"  ; 0x00000020:IN_OPEN
/data/local/tmp: 00000002 00000000 "test.txt"  ; 0x00000002:IN_MODIFY
/data/local/tmp: 00000008 00000000 "test.txt"  ; 0x00000008:IN_CLOSE_WRITE
/data/local/tmp: 00000040 00000033 "test.txt"  ; 0x00000040:IN_MOVED_FROM
/data/local/tmp: 00000080 00000033 "aaa.txt"   ; 0x00000080:IN_MOVED_TO
�� I/O ���٥�Ȥ������ [platform/bionic/libc/kernel/common/linux/inotify.h]

inotifywait ���ޥ�ɤ�Ȥ�

Android �� notify ���ޥ�ɤϥ���ѥ��ȤǼ�ڤʥġ���Ǥ��������Ϥ��ɤߤˤ����˲ä����ǥ��쥯�ȥ��۲���Ƶ�Ū�˴ƻ�Ǥ��ʤ��������ؤǤ�����¤������ġ���򼫺��Τ����򤽤��ǤϤ���ޤ�����Linux �����ˤ� inotify-tools �Ȥ����ѥå����������뤳�Ȥ��Τꡢ�����˴ޤޤ�� inotifywait ���ޥ�ɤ����Ѥ��뤳�Ȥˤ��ޤ�����

���Ǥ�ï���� Android ���ư��� inotifywait ��ӥ�ɤ����ۤ��Ƥ���ΤǤϤʤ����ȥͥåȾ��õ�����Ȥ�����������ʤ��ä�����긵�ǥӥ�ɤ�Ԥ��ޤ�����inotifywait ���Τ� NDK �ǤΥӥ���Ѥ˼��ä����ץ��������Ȱ켰��ʲ��˸������ޤ���

inotifywait_bin_android.zip
md5sum [55BF0FD8365A4139D679CE0D6A3A07B3]
�ץ��������Ȱ켰�ʢ��� - github
�ʢ��� �ʲ�������ʪ���ޤޤ�ޤ������Ѥ˺ݤ��Ƥϳƥ��եȥ������Υ饤���󥹵�����餷�Ʋ�������

�� inotify-tools
  ï¿½ï¿½ï¿½î¸¢ï¿½Ô¡ï¿½Rohan McGovern, Radu Voicilas
  ï¿½é¥¤ï¿½ï¿½ï¿½ó¥¹¡ï¿½GPL version 2
  ï¿½ï¿½ï¿½ï¿½ï¿½È¡ï¿½https://github.com/rvoicilas/inotify-tools/wiki/
�� GNU glibc POSIX ����ɽ���ؿ��� (glibc-2.11.3 ���)
  ï¿½ï¿½ï¿½î¸¢ï¿½Ô¡ï¿½Free Software Foundation, Inc.
  ï¿½é¥¤ï¿½ï¿½ï¿½ó¥¹¡ï¿½LGPL version 2.1 or later
  ï¿½ï¿½ï¿½ï¿½ï¿½È¡ï¿½http://www.gnu.org/software/libc/

inotifywait �� /data /cache /system �γƥǥ��쥯�ȥ��Ƶ�Ū�˴ƻ뤵�������֤ǡ�����Υ��ץ��HelloApp�פ�ư�����ݤν������ʲ��˼����ޤ���

# ./inotifywait -r -m /data /cache /system
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.

/system/framework/ ACCESS framework-res.apk
/system/framework/ ACCESS framework-res.apk
/data/app/ OPEN com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ OPEN com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/dalvik-cache/ OPEN data@[email protected]@classes.dex
/data/dalvik-cache/ ACCESS data@[email protected]@classes.dex
/data/dalvik-cache/ ACCESS data@[email protected]@classes.dex
/data/app/ OPEN com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/system/framework/ ACCESS framework-res.apk
/data/app/ ACCESS com.example.helloapp-1.apk
/system/fonts/ OPEN DroidSans-Bold.ttf
/system/lib/hw/ OPEN gralloc.default.so
/system/lib/hw/ ACCESS gralloc.default.so
/system/lib/hw/ ACCESS gralloc.default.so
/system/framework/ ACCESS framework-res.apk
/system/framework/ ACCESS framework-res.apk
/data/app/ CLOSE_NOWRITE,CLOSE com.example.helloapp-1.apk
              :

(tanabe)
klab_gijutsu2 at 16:51��Comments(0)��TrackBack(0)��Android | win

�ȥ�å��Хå�URL

���ε����˥����Ȥ���

̾��:
URL:
  ����òµ­²ï¿½: ɾ��: ��    ��
 
 
 
Blog�⸡��
�ǿ�����
Archives
���Υ֥����ˤĤ���
DSAS�Ȥϡ�KLab �����ۤ����Ѥ��Ƥ��륳��ƥ�ĥ����ӥ��Ѥ�Linux�١����Υ���ե�Ǥ�������5����Υǡ������󥿤ˤƹ��ۤ������Ѥ��Ƥ��ޤ������桹��DSAS����Ȥ��䤹�����������ˡ������Ƥ����ϤDZ��ѤǤ��뤳�Ȥ��ܻؤ��ơ��������ɤ˶Ф���Ǥ��ޤ���
���Υ֥����Ǥϡ������ DSAS �ǻȤäƤ��뵻�ѤξҲ�䡢�¸����Ƥߤ���̤���𡢥ȥ�֥�˴������ޤ줿���ηи��̤ʤɡ���������������������򿥤�ޤ��ƾҲ𤷤Ƥ��������Ȼפ��ޤ���
�ǿ�������
<%==comments[n].author%>
<% } %>