Code Monkey home page Code Monkey logo

Comments (5)

jpoimboe avatar jpoimboe commented on August 19, 2024

I think this would be very useful.

  • It should probably go in the patch module code in kmod/patch/kpatch-patch-hook.c.
  • You'd probably have to use an exported kallsyms function, maybe sprint_symbol_no_offset.

Thanks!

from kpatch.

ryanmiao avatar ryanmiao commented on August 19, 2024

Yes, I had implemented a draft, and why have to use sprint_symbol_no_offset ? I used lookup_symbol_name, and it also works.

I also have a question: sysfs only give show() function a PAGE_SIZE buffer. Do we need to use seq_file to store the function names?

from kpatch.

jpoimboe avatar jpoimboe commented on August 19, 2024

Ah, did you call lookup_symbol_name from the patch module? If so, kpatch-build probably hard-coded its address. It's not exported, which means it's not supposed to be used by modules, so its interface could change at any time. I think it would be cleaner and more future-proof to use a properly exported function.

To make sure that we never overrun the PAGE_SIZE buffer, maybe give each function its own sysfs file?

from kpatch.

ryanmiao avatar ryanmiao commented on August 19, 2024

Thanks for your advices I will implement them tomorrow. :)

from kpatch.

jpoimboe avatar jpoimboe commented on August 19, 2024

Closing since this will soon be merged with #180.

from kpatch.

Related Issues (20)

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.