mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-19 13:56:23 +00:00
lib: drop return value from igt_drop_caches
No one actually cares, everyone expects it to just work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
5f0ab94c3f
commit
af9d1b5cdb
@ -321,26 +321,20 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
|
|||||||
* Drop caches
|
* Drop caches
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int igt_drop_caches_set(uint64_t val)
|
void igt_drop_caches_set(uint64_t val)
|
||||||
{
|
{
|
||||||
igt_debugfs_t debugfs;
|
igt_debugfs_t debugfs;
|
||||||
int fd;
|
int fd;
|
||||||
char data[19];
|
char data[19];
|
||||||
size_t nbytes;
|
size_t nbytes;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
sprintf(data, "0x%" PRIx64, val);
|
sprintf(data, "0x%" PRIx64, val);
|
||||||
|
|
||||||
igt_debugfs_init(&debugfs);
|
igt_debugfs_init(&debugfs);
|
||||||
fd = igt_debugfs_open(&debugfs, "i915_gem_drop_caches", O_WRONLY);
|
fd = igt_debugfs_open(&debugfs, "i915_gem_drop_caches", O_WRONLY);
|
||||||
|
|
||||||
if (fd >= 0)
|
igt_assert(fd >= 0);
|
||||||
{
|
|
||||||
nbytes = write(fd, data, strlen(data) + 1);
|
nbytes = write(fd, data, strlen(data) + 1);
|
||||||
if (nbytes == strlen(data) + 1)
|
igt_assert(nbytes == strlen(data) + 1);
|
||||||
ret = 0;
|
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,6 @@ void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
|
|||||||
DROP_RETIRE | \
|
DROP_RETIRE | \
|
||||||
DROP_ACTIVE)
|
DROP_ACTIVE)
|
||||||
|
|
||||||
int igt_drop_caches_set(uint64_t val);
|
void igt_drop_caches_set(uint64_t val);
|
||||||
|
|
||||||
#endif /* __IGT_DEBUGFS_H__ */
|
#endif /* __IGT_DEBUGFS_H__ */
|
||||||
|
@ -294,7 +294,7 @@ static void do_forked_test(int fd, unsigned flags)
|
|||||||
igt_fork_helper(&thrasher) {
|
igt_fork_helper(&thrasher) {
|
||||||
while (1) {
|
while (1) {
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
do_or_die(igt_drop_caches_set(val));
|
igt_drop_caches_set(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ static void do_forked_test(int fd, unsigned flags)
|
|||||||
igt_fork_helper(&thrasher) {
|
igt_fork_helper(&thrasher) {
|
||||||
while (1) {
|
while (1) {
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
do_or_die(igt_drop_caches_set(val));
|
igt_drop_caches_set(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user