forked from mirrors/linux
		
	cachefiles: Add some subrequest tracepoints
Add some tracepoints into the cachefiles write paths. Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/20241216204124.3752367-16-dhowells@redhat.com cc: netfs@lists.linux.dev Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
		
							parent
							
								
									30f878fa0f
								
							
						
					
					
						commit
						bcb33f79e1
					
				
					 2 changed files with 7 additions and 0 deletions
				
			
		|  | @ -13,6 +13,7 @@ | ||||||
| #include <linux/falloc.h> | #include <linux/falloc.h> | ||||||
| #include <linux/sched/mm.h> | #include <linux/sched/mm.h> | ||||||
| #include <trace/events/fscache.h> | #include <trace/events/fscache.h> | ||||||
|  | #include <trace/events/netfs.h> | ||||||
| #include "internal.h" | #include "internal.h" | ||||||
| 
 | 
 | ||||||
| struct cachefiles_kiocb { | struct cachefiles_kiocb { | ||||||
|  | @ -366,6 +367,7 @@ static int cachefiles_write(struct netfs_cache_resources *cres, | ||||||
| 	if (!fscache_wait_for_operation(cres, FSCACHE_WANT_WRITE)) { | 	if (!fscache_wait_for_operation(cres, FSCACHE_WANT_WRITE)) { | ||||||
| 		if (term_func) | 		if (term_func) | ||||||
| 			term_func(term_func_priv, -ENOBUFS, false); | 			term_func(term_func_priv, -ENOBUFS, false); | ||||||
|  | 		trace_netfs_sreq(term_func_priv, netfs_sreq_trace_cache_nowrite); | ||||||
| 		return -ENOBUFS; | 		return -ENOBUFS; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -695,6 +697,7 @@ static void cachefiles_issue_write(struct netfs_io_subrequest *subreq) | ||||||
| 		iov_iter_truncate(&subreq->io_iter, len); | 		iov_iter_truncate(&subreq->io_iter, len); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	trace_netfs_sreq(subreq, netfs_sreq_trace_cache_prepare); | ||||||
| 	cachefiles_begin_secure(cache, &saved_cred); | 	cachefiles_begin_secure(cache, &saved_cred); | ||||||
| 	ret = __cachefiles_prepare_write(object, cachefiles_cres_file(cres), | 	ret = __cachefiles_prepare_write(object, cachefiles_cres_file(cres), | ||||||
| 					 &start, &len, len, true); | 					 &start, &len, len, true); | ||||||
|  | @ -704,6 +707,7 @@ static void cachefiles_issue_write(struct netfs_io_subrequest *subreq) | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	trace_netfs_sreq(subreq, netfs_sreq_trace_cache_write); | ||||||
| 	cachefiles_write(&subreq->rreq->cache_resources, | 	cachefiles_write(&subreq->rreq->cache_resources, | ||||||
| 			 subreq->start, &subreq->io_iter, | 			 subreq->start, &subreq->io_iter, | ||||||
| 			 netfs_write_subrequest_terminated, subreq); | 			 netfs_write_subrequest_terminated, subreq); | ||||||
|  |  | ||||||
|  | @ -74,6 +74,9 @@ | ||||||
| #define netfs_sreq_traces					\ | #define netfs_sreq_traces					\ | ||||||
| 	EM(netfs_sreq_trace_add_donations,	"+DON ")	\ | 	EM(netfs_sreq_trace_add_donations,	"+DON ")	\ | ||||||
| 	EM(netfs_sreq_trace_added,		"ADD  ")	\ | 	EM(netfs_sreq_trace_added,		"ADD  ")	\ | ||||||
|  | 	EM(netfs_sreq_trace_cache_nowrite,	"CA-NW")	\ | ||||||
|  | 	EM(netfs_sreq_trace_cache_prepare,	"CA-PR")	\ | ||||||
|  | 	EM(netfs_sreq_trace_cache_write,	"CA-WR")	\ | ||||||
| 	EM(netfs_sreq_trace_clear,		"CLEAR")	\ | 	EM(netfs_sreq_trace_clear,		"CLEAR")	\ | ||||||
| 	EM(netfs_sreq_trace_discard,		"DSCRD")	\ | 	EM(netfs_sreq_trace_discard,		"DSCRD")	\ | ||||||
| 	EM(netfs_sreq_trace_donate_to_prev,	"DON-P")	\ | 	EM(netfs_sreq_trace_donate_to_prev,	"DON-P")	\ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 David Howells
						David Howells