fschange – Linux File System Change Notification

dnotify and inotify are the current file change notification services in the Linux kernel. Unfortunately, they share a couple of shortcomings that make it difficult to use them for efficient (real-time) file system indexing under Linux. One of them is their unability to detect content-preserving file changes, i.e. write operations that only affect a tiny portion of a file. It is impossible to use inotify in order to determine what part of a file has actually been modified. A second problem is that you have to open every directory once before you can register for changes within that directory. This is very unconvenient, especially if you want to watch large file systems, as it requires a full scan of the file system.

fschange can be used to keep track of file changes by reading data from a proc file ( /proc/fschange). When data is written to a file, fschange reports the exact interval that has been modified instead of just saying: "This file has been changed." It also offers partial support for file changes caused by mmap and tells you when a file system is mounted or unmounted. The latter is very useful for per-file-system indexing. fschange informs about changes to every part of the file system tree. It is not necessary to register for notification on a per-directory basis. Currently, only root may access this information.

The event types supported by fschange are:
  • MOUNT device mountpoint (when a new file system is mounted)
  • UMOUNT mountpoint (when a file system is unmounted)
  • UMOUNT_REQ mountpoint (when umount has been called but failed due to file system activity, i.e. open files etc.)
  • WRITE filename from to (after a file has been changed and closed; the latter is important because it helps us reduce the number of events generated)
  • TRUNCATE filename newfilesize (after a successful call to truncate)
  • RENAME oldpath newpath (after a file or directory has been renamed or moved)
  • UNLINK filename (when a file has been removed)
  • CHMOD filename newfilemode
  • CHOWN filename newuser newgroup
  • CREATE filename (after a new file has been created)
  • MKDIR dirname
  • RMDIR dirname
Please note that in all cases the filename/dirname is a full directory path, not just the last component of the full path. File changes caused by mmap are currently only detected for x86, IA64, and x86-64.

If you want to use fschange, download the stuff below, apply the patch to your kernel, run "make oldconfig", select "M" or "Y" when asked whether you want fschange support. Then rebuild and install your new kernel. Depending on whether you selected "M" or "Y", you will either see the /proc/fschange interface directly after your system has rebooted or after you have loaded the fschange kernel module.


Available resources:
  • inotify->fschange Daemon by Kevin Fong from 2005-11-19 (8 KB)

    This program can be used to emulate fschange on a system that only supports inotify. It scans the file system, registering for changes in all directories, and prints all file system events in the fschange event format to stdout or a user-defined log file.

  • fschange for Linux 2.6.21 (and Linux 2.6.21.x) from 2007-04-27 (45 KB)

  • fschange for Linux 2.6.20 (and Linux 2.6.20.x) from 2007-04-27 (45 KB)

  • fschange for Linux 2.6.16 (and Linux 2.6.16.x) from 2006-05-03 (45 KB)

  • fschange for Linux 2.6.15 (and Linux 2.6.15.x) from 2006-01-09 (45 KB)

  • fschange for Linux 2.6.13 (and Linux 2.6.13.x) from 2005-09-23 (46 KB)

  • fschange for Linux 2.6.12 (and Linux 2.6.12.x) from 2005-07-21 (46 KB)

    This patch introduces new fschange features. When in-memory buffers are full, parts of the in-memory information are compressed (using the kernel ZLIB implementation) in order to make some space for further file events. They are decompressed later on when a process wants to read them through the proc file. This allows to store more events in the kernel buffers, while keeping memory consumption low. When all compressed buffers are full, a new file system event "ERROR buffers full" is created.

  • fschange for Linux 2.6.12 (and Linux 2.6.12.x) from 2005-06-27 (36 KB)

  • fschange for Linux 2.6.11 (and Linux 2.6.11.x) from 2005-04-15 (36 KB)

11-19 22:59:54.666288 2556 2556 E [OPLUS_AFS_CONFIG]: Failed to open AFS config file: /proc/oplus_afs_config/afs_config 11-19 22:59:54.666306 2556 2556 E AFS_CONFIG: Failed to get scene config 11-19 22:59:54.666326 2556 2556 E OplusAfsManager: afsConfigSceneConfigGet sceneType is null 11-19 22:59:54.666356 2556 2556 I SystemUi--Common: AnimAfsManager-->enableAnimationCtrl key:1 enable:false, result: 0 11-19 22:59:54.666386 2556 2556 D SystemUi--Common: JankUtils-->gfxSceneEnd; scene: 1 11-19 22:59:54.666498 2556 2556 I SystemUi--Common: NotificationShadeDepthC-->sceneFlag: 0x001, isStart = false, Current sceneFlags: 0x100 11-19 22:59:54.666528 2556 2556 D NavigationBar: restrainNavigationBarInvertColor: true 11-19 22:59:54.666550 2556 2556 D RegionSamplingHelper: animation scene, no need register sampling listener 11-19 22:59:54.666592 2556 2556 D SystemUi--Notification: NotifInflateDelay-->stopWaitAction:: type = 2 11-19 22:59:54.666660 2556 2556 I SystemUi--Notification: NotificationStackScrollLayoutExtImpl-->setLayerType isHardware=false, visibleChildren: 1 11-19 22:59:54.666790 2556 2556 I SystemUi--Notification: OplusSpringAnimation-->onFractionEnd, endFraction=1.0 isAnimationRunning true 11-19 22:59:54.666896 2556 2708 D SystemUi--Notification: NotificationPanelViewControllerExImp-->set 30 fps when panel is fully expanded. low frame rate package:com.tencent.tmgp.sgame 11-19 22:59:54.666964 2556 2556 I SystemUi--Notification: PanelAnimationEx-->resetHeightAnimator oplusSpringAnimation 11-19 22:59:54.667189 2755 2755 I OplusOverviewProxyImpl[u0]: updateUserLockedStateIfNeed: pre update isUserUnLocked: true 11-19 22:59:54.667234 2556 2556 D SystemUi--QuickSettings: OplusQsVolumeSliderController-->setListening listening=true 11-19 22:59:54.667351 2556 2556 I SystemUi--QuickSettings: OplusQsBrightnessSliderController-->setListening listening:true mView: com.oplus.systemui.qs.widget.OplusQsToggleSliderLayout{d312263 V.E...... ........ 0,0-209,444 #7f0a0210 app:id/brightness_seekbar_container alpha=1.0 viewInfo = } value:3135 11-19 22:59:54.667417 2556 2556 D SystemUi--QuickSettings: CentralSurfaces.BrightnessController-->registerCallbacks mControl: com.oplus.systemui.qs.slider.OplusQsBrightnessSliderController@4c7bb0a 11-19 22:59:54.667491 2556 2556 D SystemUi--QuickSettings: QSFragmentHelper-->setListening true 11-19 22:59:54.667816 2556 3225 D SystemUi--Notification: NotificationPanelViewControllerExImp-->sendPullMessageToOthers::KEYGUARD_SHOWING=false,QS_EXPANDED=true,QS_FULLY_EXPANDED=true,PANEL_EXPANDED=true 11-19 22:59:54.668227 2556 2556 I SystemUi--Notification: PanelAnimationEx-->blurFactionAnimation onAnimationEnd, value=1.0 blurFraction=1.0 false 11-19 22:59:54.670667 6795 13220 D OplusGraphicsEvent: FRTC type change to 1, rate: 30, info: false 11-19 22:59:54.670788 6795 13220 I GuiUtils: VRR [FRTC] s client update frtcType from 0 to 1 11-19 22:59:54.670803 6795 13220 I GuiUtils: VRR [FRTC] s client update frtcRate from 0 to 30 11-19 22:59:54.690020 2556 2556 D SystemUi--Notification: NotificationsQSContainerController-->calculateBottomSpacing:isGestureNavigation=true containerPadding=0 stackScrollMargin=96 qsContainerPadding=72 11-19 22:59:54.725169 1236 1236 I BufferQueueProducer: [19d3954 SurfaceView[com.tencent.tmgp.sgame/com.tencent.tmgp.sgame.SGameActivity](BLAST)#173](this:0xb400007969515ad8,id:-1,api:0,p:-1,c:1236) queueBuffer: fps=76.22 dur=1023.38 max=66.56 min=7.90 11-19 22:59:54.758531 1131 1131 D SensorFeature: name=ssc_screenshot_info ,index = 22 11-19 22:59:54.758722 1131 1131 D SensorFeature: write 32 bytes:659077518654,659085895884,2585,1 11-19 22:59:54.789737 2556 2556 I SystemUi--Notification: NotificationPanelSeparateAnimation-->alphaAnimateTo end canceled=false, value=1.0 11-19 22:59:54.789847 2556 2556 I SystemUi--Notification: NotificationPanelSeparateAnimation-->scaleAnimateTo end canceled=false, value=1.0 11-19 22:59:54.800843 1105 1244 I OriginChannel: now system_time:659166 pwm_rgb: system_time:658916, lux:41, time_delta:8, pwm_turbo:0, bri:2704, r:2232, g:2391, b:1966, c:10002, algo:2, end:2584, ts:658822408784 pwm_rgb: system_time:658916, lux:41, time_delta:8, pwm_turbo:0, bri:2704, r:2232, g:2338, b:1966, c:10002, algo:2, end:2584, ts:658830775784 pwm_rgb: system_time:658916, lux:41, time_delta:8, pwm_turbo:0, bri:2704, r:2232, g:2338, b:1966, c:10002, algo:2, end:2584, ts:658839142784 pwm_rgb: system_time:658916, lux:41, time_delta:8, pwm_turbo:0, bri:2704, r:2232, g:2338, b:1966, c:10002, algo:2, end:2584, ts:658847509784 pwm_rgb: system_time:658916, lux:41, time_delta:8, pwm_turbo:0, bri:2704, r:2232, g:2338, b:1966, c:9954, algo:2, end:68120, ts:658855876784 11-19 22:59:54.801185 1967 2188 D FusionLightNextGen: process end reported = 1, mode: 0, cnt: 2605, lux 0.0, cct -1.0, r/g/b/c: 2232.0/2391.0/1966.0/10002.0, R/G/B: 65.0/70.0/75.0, bri 2704.0, match 0.96, ir 0.388422, conf 0.0, ts 659098242222 11-19 22:59:54.830744 2556 2556 I SystemUi--Notification: NotificationPanelChildAppearAnimationManager-->[animateTo] animationEnd isShow=false, canceled=false, android.widget.FrameLayout{8871ba V.E...... ........ 69,0-203,90 #7f0a0abc app:id/qs_fake_clock_container alpha=0.0 viewInfo = } 11-19 22:59:54.830865 2556 2556 I SystemUi--Notification: NotificationPanelChildAppearAnimationManager-->[animateTo] animationEnd isShow=true, canceled=false, android.widget.LinearLayout{be675fd V.E...... ........ 48,0-513,198 #7f0a05d2 app:id/hl_tile_one_holder alpha=1.0 viewInfo = } 11-19 22:59:54.839052 2556 2556 I SystemUi--Notification: NotificationPanelChildAppearAnimationManager-->[animateTo] animationEnd isShow=true, canceled=false, com.android.systemui.qs.QSPanel{e31b2fa VFE...... ........ 0,0-1074,252 #7f0a0b06 app:id/quick_settings_panel alpha=1.0 viewInfo = } 11-19 22:59:54.839695 2858 2858 D AtomGameLatencyInfo: TOP APP: com.tencent.tmgp.sgame 11-19 22:59:54.855794 2556 2556 I SystemUi--Notification: NotificationPanelChildAppearAnimationManager-->[animateTo] animationEnd isShow=true, canceled=false, com.oplus.systemui.qs.OplusQSBottomImpl{a592bde V.E...... ........ 0,0-1074,18 #7f0a0aa0 app:id/qs_bottom alpha=1.0 viewInfo = } 11-19 22:59:54.893373 1118 1139 I mtkpower@impl: [setMode] type:6, enabled:0 11-19 22:59:54.893430 1118 1139 E mtkpower@impl: [setMode] unknown type 11-19 22:59:54.930490 1117 1203 W android.hardware.thermal-service.mediatek: parseMsg: Get from client TYPE=thermal_hal_notify NAME=SKIN 11-19 22:59:54.930576 1117 1203 W android.hardware.thermal-service.mediatek: parseMsg:name.c_str():SKIN 11-19 22:59:54.930588 1117 1203 W android.hardware.thermal-service.mediatek: parseMsg:tz notify:SKIN 11-19 22:59:54.930646 1117 1203 I android.hardware.thermal-service.mediatek: Wait to accept a connection 11-19 22:59:54.930861 1117 1203 I android.hardware.thermal-service.mediatek: Sending notification: Type: SKIN Name: SKIN CurrentValue: 42.534 ThrottlingStatus: SEVERE 11-19 22:59:54.931006 1117 1203 I android.hardware.thermal-service.mediatek: sendThermalChangedCallback 11-19 22:59:54.931834 1967 2832 E ThermalManagerService: No threshold found for shell_skin 11-19 22:59:54.931993 1967 2832 E ThermalManagerService: No threshold found for shell_skin 11-19 22:59:55.002320 1131 1131 D SensorFeature: name=ssc_screenshot_info ,index = 22 11-19 22:59:55.002489 1131 1131 D SensorFeature: write 32 bytes:659303174499,659336600037,2586,1 11-19 22:59:55.025364 1967 2012 W QosScheduler: getScenario failed! scenarios is null, mask=4 11-19 22:59:55.025435 1967 2012 W QosScheduler: executeSceneQosStrategy get scenario failed! scenario is null 11-19 22:59:55.028620 1284 1284 I touch_boost: enable=0, boost_up=0, boost_down=1, render_deboost=0, active_time=100, duration=120, idleprefer(TA,FG)=(0,0), util(TA,FG)=(0,0), freq(c0,c1,c2)=(1300000,1600000,0) 11-19 22:59:55.028638 1967 2220 I InputReader: notifyMotion event: [EV_ABS ABS_MT_TRACKING_ID 738][EV_KEY BTN_TOUCH DOWN][EV_KEY BTN_TOOL_FINGER DOWN][EV_ABS ABS_MT_PRESSURE 5][EV_ABS 0 3832][EV_ABS 1 12922][EV_ABS ABS_PROFILE 473][EV_SYN SYN_REPORT 0] 11-19 22:59:55.028705 1284 1284 I touch_boost: set_top_grp_aware 11-19 22:59:55.028720 1284 1284 I mtkpower_client: perf_lock_acq, hdl:345, dur:2000, num:4, pid:1284, tid:1284 11-19 22:59:55.029220 1967 2219 V InputDispatcher: dispatchMotion - eventTime=659394244000, deviceId=4, source=TOUCHSCREEN, displayId=0, policyFlags=0x62000000, action=DOWN, actionButton=0x0, flags=0x0, metaState=0x0, buttonState=0x0,edgeFlags=0x0, xPrecision=16.000000, yPrecision=16.000000, downTime=659394244000 11-19 22:59:55.029327 1284 1284 I mtkpower_client: ret_hdl:345 11-19 22:59:55.029436 1284 1284 I touch_boost: enable=1, boost_up=0, boost_down=1, render_deboost=0, active_time=100, duration=120, idleprefer(TA,FG)=(0,0), util(TA,FG)=(0,0), freq(c0,c1,c2)=(1300000,1600000,0) 11-19 22:59:55.029458 1284 1284 I mtkpower_client: perf_lock_acq, hdl:0, dur:120, num:14, pid:1284, tid:1284 11-19 22:59:55.029471 1967 2219 V system_server: addOrUpdateWindow out windows: set 1944658 NotificationShade firstDownTimeInTarget to 659394244000 flags=FOREGROUND | SPLIT dispatchMode=0 deviceid=4 11-19 22:59:55.029489 1967 2219 V system_server: addOrUpdateWindow out windows: set [Gesture Monitor] OplusExInputReceiver1 firstDownTimeInTarget to 659394244000 flags=SPLIT dispatchMode=0 deviceid=4 11-19 22:59:55.029510 1967 2219 V system_server: addOrUpdateWindow out windows: set [Gesture Monitor] OplusUAHInputChannel firstDownTimeInTarget to 659394244000 flags=SPLIT dispatchMode=0 deviceid=4 11-19 22:59:55.029654 1967 2219 I InputDispatcher: Publishing 1944658 NotificationShade status: OK seq=109852, Pointers = (no-secure, no-secure) action=DOWN downTime=659394244000 eventTime= 659394244000 transformForDebugInput (ROT_270) (ROTATE TRANSLATE); 0.0000 1.0000 0.0000; -1.0000 0.0000 1080.0000; 0.0000 0.0000 1.0000; 11-19 22:59:55.029938 2556 2556 W InputLog: VRI[NotificationShade] : debugInputEventStart event=MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=807.625, y[0]=840.4375, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=659394, downTime=659394, deviceId=4, source=0x1002, displayId=0, eventId=563493292 } 11-19 22:59:55.030132 2556 2556 V AutofillManager: requestHideFillUi(null): anchor = null 11-19 22:59:55.030149 2556 2556 V Application: getAutofillClient(): null on super, trying to find activity thread 11-19 22:59:55.030251 2556 2556 V Application: getAutofillClient(): none of the 0 activities on com.android.systemui.SystemUIApplication@3c506e9 are top resumed nor have focus 11-19 22:59:55.030146 1967 2061 D PowerManagerService: userActivityNoUpdateLocked: groupId=0, eventTime=659394, event=touch, flags=0x0, uid=1000 11-19 22:59:55.030263 2556 2556 V AutofillManager: No AutofillClient for com.android.systemui on context com.android.systemui.SystemUIApplication@3c506e9 11-19 22:59:55.030319 1967 2389 D GestureLog_OplusMultiPointerDetector: onTouchEvent------>start, mCurNumPointers=1, mCurrStatus=0 mIsDownIntervalTimeout=true, action=0 downTime=659394 deviceId=4 11-19 22:59:55.030384 1967 2696 I [UAH_CLIENT]: UahEventAcquire, cmdid:37, pkg:none, identity:OplusUAwareInputHelper 11-19 22:59:55.030429 2556 2556 E Input_Track: [Input] Start <<<<<<<<<<<<<< 563493292 11-19 22:59:55.030615 2556 2556 I SystemUi--Statusbar: NotifShadeWindowVC-->isSeparaOrMergeQsVisible: true 11-19 22:59:55.030842 1967 2696 D UAH-UahAdaptHelper: adaptSetNotification identity = OplusUAwareInputHelpersrc = 1000 , type 0 ,p1 = -1 ,p2 = -1 ,p3 = -1 ,p4 = 11-19 22:59:55.030867 1967 2696 I [UAH_CLIENT]: uahRuleCtl, ruleId:1000, status:0 11-19 22:59:55.031181 2556 2556 D SystemUi--Notification: NotificationPanelViewControllerExImp-->setHeadsUpSwipeUp swipeUp: false 11-19 22:59:55.031206 2556 2556 D SystemUi--Notification: NotificationPanelViewControllerExImp-->isStartedZoomAnimation=false isTracking=false 11-19 22:59:55.031267 1155 4333 I mtkpower@impl: [libpowerhal_setCpuIdle] set cpu idle from uah, idx = 0 11-19 22:59:55.031543 2556 2556 I SystemUi--Keyguard: KeyguardStyleClockController-->isTouchInAnyWidget false 11-19 22:59:55.031562 2556 2556 I SystemUi--Notification: NotificationPanelView-->onInterceptTouchEvent mAnimatingOnDown false mClosing false mIsSpringBackAnimation false 11-19 22:59:55.031689 1967 2210 D WindowManagerServiceExtImpl: check WindowContainer preconditions. 这些打印了啥意思
最新发布
12-05
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值