Skip to content

Commit

Permalink
trace: Generated streq-helper to ignore null terminator
Browse files Browse the repository at this point in the history
  • Loading branch information
goldshtn committed Jan 17, 2017
1 parent fd44cd2 commit b9aec34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ def _generate_streq_function(self, string):
fname = "streq_%d" % Probe.streq_index
Probe.streq_index += 1
self.streq_functions += """
static inline bool %s(char const *ignored, unsigned long str) {
static inline bool %s(char const *ignored, uintptr_t str) {
char needle[] = %s;
char haystack[sizeof(needle)];
bpf_probe_read(&haystack, sizeof(haystack), (void *)str);
for (int i = 0; i < sizeof(needle); ++i) {
for (int i = 0; i < sizeof(needle)-1; ++i) {
if (needle[i] != haystack[i]) {
return false;
}
Expand Down

0 comments on commit b9aec34

Please sign in to comment.