Fix remaining problems for 32 bits architectures

This commit is contained in:
Rodrigo Arias 2024-06-21 11:59:16 +02:00
parent 3103018404
commit 3fdbb95080
4 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "cpu.h"
@ -17,7 +17,7 @@
#include "utlist.h"
#include "value.h"
static const char chan_fmt[] = "cpu%ld.%s";
static const char chan_fmt[] = "cpu%"PRIi64".%s";
static const char *chan_name[CPU_CHAN_MAX] = {
[CPU_CHAN_NRUN] = "nrunning",
[CPU_CHAN_PID] = "pid_running",

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "model_thread.h"
@ -19,7 +19,7 @@
static int
init_chan(struct model_thread *th, const struct model_chan_spec *spec, int64_t gindex)
{
const char *fmt = "%s.thread%ld.%s";
const char *fmt = "%s.thread%"PRIi64".%s";
const char *prefix = spec->prefix;
th->ch = calloc(spec->nch, sizeof(struct chan));

View File

@ -33,8 +33,8 @@ static int
create_cpu(struct bay *bay, struct nosv_breakdown_cpu *bcpu, int64_t gindex)
{
enum chan_type t = CHAN_SINGLE;
chan_init(&bcpu->tr, t, "nosv.cpu%ld.breakdown.tr", gindex);
chan_init(&bcpu->tri, t, "nosv.cpu%ld.breakdown.tri", gindex);
chan_init(&bcpu->tr, t, "nosv.cpu%"PRIi64".breakdown.tr", gindex);
chan_init(&bcpu->tri, t, "nosv.cpu%"PRIi64".breakdown.tri", gindex);
/* Register all channels in the bay */
if (bay_register(bay, &bcpu->tr) != 0) {
@ -161,7 +161,7 @@ select_tr(struct mux *mux, struct value value, struct mux_input **input)
int64_t i = in_body;
char *inputs[] = { "subsystem", "task_type" };
dbg("selecting input %ld (%s)", i, inputs[i]);
dbg("selecting input %"PRIi64" (%s)", i, inputs[i]);
*input = mux_get_input(mux, i);
return 0;
@ -327,7 +327,7 @@ model_nosv_breakdown_finish(struct emu *emu,
struct prf *prf = pvt_get_prf(bemu->pvt);
for (int64_t row = 0; row < bemu->nphycpus; row++) {
char name[128];
if (snprintf(name, 128, "~CPU %4ld", bemu->nphycpus - row) >= 128) {
if (snprintf(name, 128, "~CPU %4"PRIi64, bemu->nphycpus - row) >= 128) {
err("label too long");
return -1;
}

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "prv.h"
@ -69,9 +69,9 @@ find_prv_chan(struct prv *prv, long id)
}
static void
write_line(struct prv *prv, long row_base1, long type, long value)
write_line(struct prv *prv, long row_base1, int64_t type, int64_t value)
{
fprintf(prv->file, "2:0:1:1:%ld:%" PRIi64 ":%ld:%ld\n",
fprintf(prv->file, "2:0:1:1:%ld:%"PRIi64":%"PRIi64":%"PRIi64"\n",
row_base1, prv->time, type, value);
}
@ -117,7 +117,7 @@ emit(struct prv *prv, struct prv_chan *rchan)
}
/* Assume null */
long val = 0;
int64_t val = 0;
if (likely(value.type == VALUE_INT64)) {
val = value.i;
if (rchan->flags & PRV_NEXT)