diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-05-02 19:48:26 +0300 | 
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-05-02 19:48:26 +0300 | 
| commit | 0337966d121ebebf73a1c346123e8112796e684e (patch) | |
| tree | c0d4388591e72dc5a26ee976a9cbca70f6bafbbd /tools/lib/api/fs/tracing_path.c | |
| parent | 7c5bb4ac2b76d2a09256aec8a7d584bf3e2b0466 (diff) | |
| parent | 8a038b83e012097a7ac6cfb9f6c5fac1da8fad6e (diff) | |
| download | linux-0337966d121ebebf73a1c346123e8112796e684e.tar.xz | |
Merge branch 'next' into for-linus
Prepare input updates for 4.12 merge window.
Diffstat (limited to 'tools/lib/api/fs/tracing_path.c')
| -rw-r--r-- | tools/lib/api/fs/tracing_path.c | 32 | 
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c index 251b7c342a87..3e606b9c443e 100644 --- a/tools/lib/api/fs/tracing_path.c +++ b/tools/lib/api/fs/tracing_path.c @@ -86,9 +86,13 @@ void put_tracing_file(char *file)  	free(file);  } -static int strerror_open(int err, char *buf, size_t size, const char *filename) +int tracing_path__strerror_open_tp(int err, char *buf, size_t size, +				   const char *sys, const char *name)  {  	char sbuf[128]; +	char filename[PATH_MAX]; + +	snprintf(filename, PATH_MAX, "%s/%s", sys, name ?: "*");  	switch (err) {  	case ENOENT: @@ -99,10 +103,19 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)  		 * - jirka  		 */  		if (debugfs__configured() || tracefs__configured()) { -			snprintf(buf, size, -				 "Error:\tFile %s/%s not found.\n" -				 "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n", -				 tracing_events_path, filename); +			/* sdt markers */ +			if (!strncmp(filename, "sdt_", 4)) { +				snprintf(buf, size, +					"Error:\tFile %s/%s not found.\n" +					"Hint:\tSDT event cannot be directly recorded on.\n" +					"\tPlease first use 'perf probe %s:%s' before recording it.\n", +					tracing_events_path, filename, sys, name); +			} else { +				snprintf(buf, size, +					 "Error:\tFile %s/%s not found.\n" +					 "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n", +					 tracing_events_path, filename); +			}  			break;  		}  		snprintf(buf, size, "%s", @@ -125,12 +138,3 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)  	return 0;  } - -int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name) -{ -	char path[PATH_MAX]; - -	snprintf(path, PATH_MAX, "%s/%s", sys, name ?: "*"); - -	return strerror_open(err, buf, size, path); -}  | 
