mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	perf daemon: Fix the build on 32-bit architectures
Noticed with:
   1     6.22 debian:experimental-x-mipsel  : FAIL gcc version 13.2.0 (Debian 13.2.0-25)
    builtin-daemon.c: In function 'cmd_session_list':
    builtin-daemon.c:691:35: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'time_t' {aka 'long long int'} [-Werror=format=]
Use inttypes.h's PRIu64 to deal with that.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/ZplvH21aQ8pzmza_@x1
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									d5b854893d
								
							
						
					
					
						commit
						4bbe600293
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include <internal/lib.h>
 | 
					#include <internal/lib.h>
 | 
				
			||||||
 | 
					#include <inttypes.h>
 | 
				
			||||||
#include <subcmd/parse-options.h>
 | 
					#include <subcmd/parse-options.h>
 | 
				
			||||||
#include <api/fd/array.h>
 | 
					#include <api/fd/array.h>
 | 
				
			||||||
#include <api/fs/fs.h>
 | 
					#include <api/fs/fs.h>
 | 
				
			||||||
| 
						 | 
					@ -688,7 +689,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
 | 
				
			||||||
			/* lock */
 | 
								/* lock */
 | 
				
			||||||
			csv_sep, daemon->base, "lock");
 | 
								csv_sep, daemon->base, "lock");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		fprintf(out, "%c%lu",
 | 
							fprintf(out, "%c%" PRIu64,
 | 
				
			||||||
			/* session up time */
 | 
								/* session up time */
 | 
				
			||||||
			csv_sep, (curr - daemon->start) / 60);
 | 
								csv_sep, (curr - daemon->start) / 60);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -700,7 +701,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
 | 
				
			||||||
				daemon->base, SESSION_OUTPUT);
 | 
									daemon->base, SESSION_OUTPUT);
 | 
				
			||||||
			fprintf(out, "  lock:    %s/lock\n",
 | 
								fprintf(out, "  lock:    %s/lock\n",
 | 
				
			||||||
				daemon->base);
 | 
									daemon->base);
 | 
				
			||||||
			fprintf(out, "  up:      %lu minutes\n",
 | 
								fprintf(out, "  up:      %" PRIu64 " minutes\n",
 | 
				
			||||||
				(curr - daemon->start) / 60);
 | 
									(curr - daemon->start) / 60);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -727,7 +728,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
 | 
				
			||||||
				/* session ack */
 | 
									/* session ack */
 | 
				
			||||||
				csv_sep, session->base, SESSION_ACK);
 | 
									csv_sep, session->base, SESSION_ACK);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			fprintf(out, "%c%lu",
 | 
								fprintf(out, "%c%" PRIu64,
 | 
				
			||||||
				/* session up time */
 | 
									/* session up time */
 | 
				
			||||||
				csv_sep, (curr - session->start) / 60);
 | 
									csv_sep, (curr - session->start) / 60);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -745,7 +746,7 @@ static int cmd_session_list(struct daemon *daemon, union cmd *cmd, FILE *out)
 | 
				
			||||||
				session->base, SESSION_CONTROL);
 | 
									session->base, SESSION_CONTROL);
 | 
				
			||||||
			fprintf(out, "  ack:     %s/%s\n",
 | 
								fprintf(out, "  ack:     %s/%s\n",
 | 
				
			||||||
				session->base, SESSION_ACK);
 | 
									session->base, SESSION_ACK);
 | 
				
			||||||
			fprintf(out, "  up:      %lu minutes\n",
 | 
								fprintf(out, "  up:      %" PRIu64 " minutes\n",
 | 
				
			||||||
				(curr - session->start) / 60);
 | 
									(curr - session->start) / 60);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue