GithubHelp home page GithubHelp logo

trunk96 / schedule_hook Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 133 KB

Linux Kernel schedule() function patcher

License: GNU General Public License v3.0

Makefile 25.69% Shell 40.50% M4 1.85% Assembly 7.40% C 24.56%

schedule_hook's Introduction

schedule-hook

A kernel module that dynamically patches the Linux kernel scheduler so as to allow running a custom function upon thread reschedule This is the schedule-hook kernel module, to allow running a custom function e.g. in another module, upon thread reschedule

This module can be used either in cross compilation with the one containing the custom function or not

This module patches at run-time the kernel schedule() and enables running a schedule-hook function as the last task of thread re-schedule

The schedule-hook function is embedded within this module, it checks the value of a function pointer and in case it is not null the target functio is called

In cross compilation the function pointer is exported as a symbol to be updated while mounting the module containing the custom functions to be run

Otherwise, the function ponter is accessible as a pseudofile called /sys/module/schedule_hook/parameters/the_hook

In the latter configuration, after mounting the module, you can load any function pointer you would like (pointing to kernel stuff) by writing it on that pseudofile

The custom function to be run needs to get no paramter in input

Please check with the following configuration macros to manage the configuration of this module:

  • DEBUG and DEBUG_SCHEDULE_HOOK for enabling or disabling debugging/audit stuff
  • SYS_FS for enabling of disabling the reliance on /sys

NOTE: the custom function is expected to be non-blocking, in case it is blocking the unmount of this module may hang

NOTE: this module should be unmounted before unmounting the one containing the custom function otherwise your kernel will likely crash

The code has been developed by:

and is Copyright (C) 2017 HPDCS Group, http://www.dis.uniroma1.it/~hpdcs

For installation and usage information, please refer to INSTALL.

schedule_hook's People

Contributors

trunk96 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.