Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257134
b: refs/heads/master
c: bad03ae
h: refs/heads/master
v: v3
  • Loading branch information
Masami Hiramatsu authored and Steven Rostedt committed Jul 15, 2011
1 parent a992bdb commit 47de5d5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: baad2d3e69ba154dae340904a47ae12414f1894f
refs/heads/master: bad03ae476214d9d66bb96be02b630385936f788
15 changes: 0 additions & 15 deletions trunk/tools/perf/util/probe-finder.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@
/* Kprobe tracer basic type is up to u64 */
#define MAX_BASIC_TYPE_BITS 64

/*
* Compare the tail of two strings.
* Return 0 if whole of either string is same as another's tail part.
*/
static int strtailcmp(const char *s1, const char *s2)
{
int i1 = strlen(s1);
int i2 = strlen(s2);
while (--i1 >= 0 && --i2 >= 0) {
if (s1[i1] != s2[i2])
return s1[i1] - s2[i2];
}
return 0;
}

/* Line number list operations */

/* Add a line to line number list */
Expand Down
19 changes: 19 additions & 0 deletions trunk/tools/perf/util/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,22 @@ bool strlazymatch(const char *str, const char *pat)
{
return __match_glob(str, pat, true);
}

/**
* strtailcmp - Compare the tail of two strings
* @s1: 1st string to be compared
* @s2: 2nd string to be compared
*
* Return 0 if whole of either string is same as another's tail part.
*/
int strtailcmp(const char *s1, const char *s2)
{
int i1 = strlen(s1);
int i2 = strlen(s2);
while (--i1 >= 0 && --i2 >= 0) {
if (s1[i1] != s2[i2])
return s1[i1] - s2[i2];
}
return 0;
}

1 change: 1 addition & 0 deletions trunk/tools/perf/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ char **argv_split(const char *str, int *argcp);
void argv_free(char **argv);
bool strglobmatch(const char *str, const char *pat);
bool strlazymatch(const char *str, const char *pat);
int strtailcmp(const char *s1, const char *s2);
unsigned long convert_unit(unsigned long value, char *unit);
int readn(int fd, void *buf, size_t size);

Expand Down

0 comments on commit 47de5d5

Please sign in to comment.