mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-13 02:46:23 +00:00
lib: Add igt_debugfs_fopen()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
51b63e334c
commit
ffa2107abc
@ -73,3 +73,12 @@ int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename)
|
|||||||
sprintf(buf, "%s/%s", debugfs->dri_path, filename);
|
sprintf(buf, "%s/%s", debugfs->dri_path, filename);
|
||||||
return open(buf, O_RDONLY);
|
return open(buf, O_RDONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
|
||||||
|
const char *mode)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
|
||||||
|
sprintf(buf, "%s/%s", debugfs->dri_path, filename);
|
||||||
|
return fopen(buf, mode);
|
||||||
|
}
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#ifndef __IGT_DEBUGFS_H__
|
#ifndef __IGT_DEBUGFS_H__
|
||||||
#define __IGT_DEBUGFS_H__
|
#define __IGT_DEBUGFS_H__
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char root[128];
|
char root[128];
|
||||||
char dri_path[128];
|
char dri_path[128];
|
||||||
@ -32,5 +34,7 @@ typedef struct {
|
|||||||
|
|
||||||
int igt_debugfs_init(igt_debugfs_t *debugfs);
|
int igt_debugfs_init(igt_debugfs_t *debugfs);
|
||||||
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename);
|
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename);
|
||||||
|
FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
|
||||||
|
const char *mode);
|
||||||
|
|
||||||
#endif /* __IGT_DEBUGFS_H__ */
|
#endif /* __IGT_DEBUGFS_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user