perf data: Minor code style alignment cleanup
authorYang Jihong <yangjihong1@huawei.com>
Fri, 19 Jan 2024 04:03:04 +0000 (04:03 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 22 Jan 2024 20:08:21 +0000 (12:08 -0800)
Minor code style alignment cleanup for perf_data__switch() and
perf_data__write().

No functional change.

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240119040304.3708522-4-yangjihong1@huawei.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-record.c
tools/perf/util/data.c
tools/perf/util/data.h

index 5e3ea5cf14298e7ce5ee367e73fbdbd3b85bc5e3..0b6f29fa0064ea8d8cbc0e04d5f0c32eea34878f 100644 (file)
@@ -1853,16 +1853,17 @@ record__switch_output(struct record *rec, bool at_exit)
        }
 
        fd = perf_data__switch(data, timestamp,
-                                   rec->session->header.data_offset,
-                                   at_exit, &new_filename);
+                              rec->session->header.data_offset,
+                              at_exit, &new_filename);
        if (fd >= 0 && !at_exit) {
                rec->bytes_written = 0;
                rec->session->header.data_size = 0;
        }
 
-       if (!quiet)
+       if (!quiet) {
                fprintf(stderr, "[ perf record: Dump %s.%s ]\n",
                        data->path, timestamp);
+       }
 
        if (rec->switch_output.num_files) {
                int n = rec->switch_output.cur_file + 1;
index 550675ce0b787866737d1c2cbd3f4a6fc883928c..08c4bfbd817f2b0b18c8b8d3d37193e671ce69d5 100644 (file)
@@ -413,7 +413,7 @@ ssize_t perf_data_file__write(struct perf_data_file *file,
 }
 
 ssize_t perf_data__write(struct perf_data *data,
-                             void *buf, size_t size)
+                        void *buf, size_t size)
 {
        if (data->use_stdio) {
                if (fwrite(buf, size, 1, data->file.fptr) == 1)
@@ -424,9 +424,9 @@ ssize_t perf_data__write(struct perf_data *data,
 }
 
 int perf_data__switch(struct perf_data *data,
-                          const char *postfix,
-                          size_t pos, bool at_exit,
-                          char **new_filepath)
+                     const char *postfix,
+                     size_t pos, bool at_exit,
+                     char **new_filepath)
 {
        int ret;
 
index effcc195d7e9c0404cb6a90db236a4cf1761c6d7..110f3ebde30fdb4611e9ca813285d87eb857d606 100644 (file)
@@ -80,7 +80,7 @@ int perf_data__open(struct perf_data *data);
 void perf_data__close(struct perf_data *data);
 ssize_t perf_data__read(struct perf_data *data, void *buf, size_t size);
 ssize_t perf_data__write(struct perf_data *data,
-                             void *buf, size_t size);
+                        void *buf, size_t size);
 ssize_t perf_data_file__write(struct perf_data_file *file,
                              void *buf, size_t size);
 /*
@@ -91,8 +91,8 @@ ssize_t perf_data_file__write(struct perf_data_file *file,
  * Return value is fd of new output.
  */
 int perf_data__switch(struct perf_data *data,
-                          const char *postfix,
-                          size_t pos, bool at_exit, char **new_filepath);
+                     const char *postfix,
+                     size_t pos, bool at_exit, char **new_filepath);
 
 int perf_data__create_dir(struct perf_data *data, int nr);
 int perf_data__open_dir(struct perf_data *data);