Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Redis Module Debugging

137 views

Published on

Redis Module Debugging - How to Debug a Redis Module written in C language.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Redis Module Debugging

  1. 1. Redis Module Debugging Diego Pacheco
  2. 2. @diego_pacheco ❏ Cat's Father ❏ Principal Software Architect ❏ Agile Coach ❏ SOA/Microservices Expert ❏ DevOps Practitioner ❏ Speaker ❏ Author diegopacheco http://diego-pacheco.blogspot.com.br/ https://diegopacheco.github.io/ About me
  3. 3. Redis Module ❏ Runs inside Redis ❏ Low Latency ❏ Access to Redis Commands ❏ Fast -> C language ❏ Use Cases: ❏ Extend Redis ❏ New Capabilities
  4. 4. How to Debug?
  5. 5. Steps ❏ Download Redis 4.X ❏ make && make test ❏ Import on eclipse via Makefile ❏ Add the module inside Redis project ❏ Execute “server” program ❏ Configure debug with --loadmodule ❏ Goto .so file add a breakpoint in C code. ❏ Have Fun :D
  6. 6. Get Redis 4.x wget http://download.redis.io/releases/redis-4.0.1.tar.gz tar -xzvf redis-4.0.1.tar.gz rm -rf redis-4.0.1.tar.gz cd redis-4.0.1/ make make test
  7. 7. Import on Eclipse cpp
  8. 8. Add Module code on Redis project 1. Create a folder inside redis project called “modules” 2. Add the modules code to that folder, like: a. Module C code - i,e: date.c b. Redis Modules API -> redismodule.h c. Make Script -> Makefile d. Build Script -> build.sh 3. When you run ./build.sh a. We will compile date -> date.o b. We will compile the module -> redis_date_module.so
  9. 9. Configure to Debug Redis
  10. 10. Configure to Debug Redis
  11. 11. Add a breakpoint on C code
  12. 12. Run The Debug
  13. 13. Call the Command on redis-cli redis-cli dp.date
  14. 14. Debug on guys :D
  15. 15. Redis Module Debugging Diego Pacheco

×