proc_loadavg.c 811 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #include "proc.h"
  10. #include "procfs.h"
  11. #include <rthw.h>
  12. #include <rtdbg.h>
  13. #include <fcntl.h>
  14. #include <errno.h>
  15. #include <dfs_dentry.h>
  16. #include <mm_page.h>
  17. extern void rt_memory_info(rt_size_t *total,
  18. rt_size_t *used,
  19. rt_size_t *max_used);
  20. static int single_show(struct dfs_seq_file *seq, void *data)
  21. {
  22. dfs_seq_printf(seq, "0.13 0.16 0.17 1/1035 380436\n");
  23. return 0;
  24. }
  25. int proc_loadavg_init(void)
  26. {
  27. struct proc_dentry *dentry = proc_create_single_data("loadavg", 0, NULL, single_show, NULL);
  28. proc_release(dentry);
  29. return 0;
  30. }
  31. INIT_ENV_EXPORT(proc_loadavg_init);