Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

usdt_tracepoints_x86_64.s 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright (c) 2012, Chris Andrews. All rights reserved.
  3. */
  4. /*
  5. * Stub functions containing DTrace tracepoints for probes and
  6. * is-enabled probes. These functions are copied for each probe
  7. * dynamically created.
  8. *
  9. */
  10. .text
  11. .align 4, 0x90
  12. .globl usdt_tracepoint_isenabled
  13. .globl _usdt_tracepoint_isenabled
  14. .globl usdt_tracepoint_probe
  15. .globl _usdt_tracepoint_probe
  16. .globl usdt_tracepoint_end
  17. .globl _usdt_tracepoint_end
  18. .globl usdt_probe_args
  19. .globl _usdt_probe_args
  20. usdt_tracepoint_isenabled:
  21. _usdt_tracepoint_isenabled:
  22. pushq %rbp
  23. movq %rsp, %rbp
  24. addq $1, %rax
  25. xorq %rax, %rax
  26. nop
  27. nop
  28. leave
  29. ret
  30. usdt_tracepoint_probe:
  31. _usdt_tracepoint_probe:
  32. nop
  33. nop
  34. nop
  35. nop
  36. nop
  37. addq %r14,%rsp
  38. popq %rbx
  39. popq %r14
  40. popq %r13
  41. popq %r12
  42. leave
  43. usdt_tracepoint_end:
  44. _usdt_tracepoint_end:
  45. ret
  46. /*
  47. * Probe argument marshalling, x86_64 style
  48. *
  49. */
  50. usdt_probe_args:
  51. _usdt_probe_args:
  52. pushq %rbp
  53. movq %rsp,%rbp
  54. pushq %r12
  55. pushq %r13
  56. pushq %r14
  57. pushq %rbx
  58. movq %rdi,%r12
  59. movq %rsi,%rbx
  60. movq %rdx,%r11
  61. movq $0,%r14
  62. test %rbx,%rbx
  63. je fire
  64. movq (%r11),%rdi
  65. dec %rbx
  66. test %rbx,%rbx
  67. je fire
  68. addq $8,%r11
  69. movq (%r11),%rsi
  70. dec %rbx
  71. test %rbx,%rbx
  72. je fire
  73. addq $8,%r11
  74. movq (%r11),%rdx
  75. dec %rbx
  76. test %rbx,%rbx
  77. je fire
  78. addq $8,%r11
  79. movq (%r11),%rcx
  80. dec %rbx
  81. test %rbx,%rbx
  82. je fire
  83. addq $8,%r11
  84. movq (%r11),%r8
  85. dec %rbx
  86. test %rbx,%rbx
  87. je fire
  88. addq $8,%r11
  89. movq (%r11),%r9
  90. movq %rbx,%r13
  91. morestack:
  92. dec %rbx
  93. test %rbx,%rbx
  94. je args
  95. subq $16,%rsp
  96. addq $16,%r14
  97. dec %rbx
  98. test %rbx,%rbx
  99. je args
  100. jmp morestack
  101. args:
  102. movq %r13,%rbx
  103. movq $0,%r13
  104. moreargs:
  105. dec %rbx
  106. test %rbx,%rbx
  107. je fire
  108. addq $8,%r11
  109. movq (%r11),%rax
  110. movq %rax,(%rsp,%r13)
  111. addq $8,%r13
  112. jmp moreargs
  113. fire: jmp *%r12