Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: procfs

Sep 01, 2010

  1. Jérémie Koenig

    procfs: Use 2 instead of 42 as the parent inode number

    * procfs/procfs.c (procfs_make_ino): Use 2 rather than 42 as a temporary hack,
      since 2 is the root's inode with ext2fs.
  2. Jérémie Koenig

    procfs: Use the user-provided kernel PID for uptime

    * procfs/rootdir.c (get_boottime, get_idletime): replace KERNEL_PID with the
      opt_kernel_pid command-line option.
    * procfs/main.c (argp): Document the change.

Aug 30, 2010

  1. Jérémie Koenig

    procfs: Add copyright notices

    * dircat.c, dircat.h, main.c, main.h, netfs.c, process.c, process.h,
      procfs.c, procfs.h, procfs_dir.c, procfs_dir.h, proclist.c,
      proclist.h, rootdir.c, rootdir.h: Add copyright notices.
  2. Jérémie Koenig

    procfs: Integrate into the larger build system

    * Makefile: Add procfs as a subdirectory.
    * procfs/Makefile: Rewrite as a subdir Makefile.
    * procfs/rootdir.c: Use the PROF preprocessor constant to identify
      profiling builds.
  3. Jérémie Koenig

    procfs: Update the to-do list.

    * procfs/TODO: Add more entries.
  4. Jérémie Koenig

    procfs: Add some comments in rootdir.c

    * procfs/rootdir.c: Add page breaks to separate sections and add header
      comments for them.
  5. Jérémie Koenig

    procfs: Add swap information to the top-level stat file

    * procfs/rootdir.c (rootdir_gc_meminfo): Add swap information.
    * procfs/TODO: Update.
  6. Jérémie Koenig

    procfs: Add a PROFILE mode

    * procfs/Makefile: Change FOOFLAGS defaults to appropriate values when
      $(PROFILE) is defined.
    * procfs/rootdir.c: Add an "exit" file, which causes exit to be called
      when looked up, so that profiling data can be written to disk.
  7. Jérémie Koenig

    procfs: Fix leak in error case

    * procfs/process.c (process_lookup_pid): Fix leak in error case.
  8. Jérémie Koenig

    procfs: Refresh nodes when they're read from the start.

    This is necessary for top, for instance, which keeps some files open and
    re-reads them regularly. As an extra bonus we can drop the refresh hack.
    * procfs/procfs.c, procfs/procfs.h: Remove the refresh hack.
      (procfs_refresh): New function, invalidates the cached contents.
    * procfs/netfs.c (netfs_attempt_read, netfs_get_dirents): Call
      procfs_refresh when the read is from offset 0.
    * procfs/proclist.c (proclist_make_node): Remove the refresh hack.
    * procfs/dircat.c (dircat_make_node): Likewise.
      (dircat_get_contents): Use procfs_refresh to avoid keeping old data
      from the component nodes.
  9. Jérémie Koenig

    procfs: Make sure the clock never runs backwards.

    * procfs/process.c, procfs/rootdir.c: When converting timeval structures
      into seconds or jiffies, make sure that floating point rounding errors
      don't make the clock the result jump backwards on second boundaries.
  10. Jérémie Koenig

    procfs: Fix the global idle time

    * procfs/rootdir.c: Replace INIT_PID by KERNEL_PID, for boot time and
      idle time purposes.  (get_idletime): New function, queries the
      kernel's idle thread.  (rootdir_gc_uptime, rootdir_gc_stat): Use the
      new function and provide the real idle time.
  11. Jérémie Koenig

    procfs: Cleanup pass on process.c

    * procfs/process.c: Reorder some of the code.  Improve comments.
      Jiffies and clock tick are the same thing, right?  Replace the stat
      mode and cleanup hacks by more straightforward solutions.
  12. Jérémie Koenig

    procfs: Revamp procfs_dir

    * procfs/procfs_dir.c, procfs/procfs_dir.h: Revamp the interface to make
      the more complicated use cases somewhat less hackish.
    * procfs/process.c: Update, specify a default make_node function.
    * procfs/rootdir.c: Likewise; make this optional "self" link use case
      somewhat less hackish.
  13. Jérémie Koenig

    procfs: Improve the interface for dircat_make_node

    * procfs/dircat.c, procfs/dircat.h (dircat_make_node): Use an explicit
      array size for DIRS, fail with ENOMEM is any of them is NULL, and
      release the reference on the non-NULL nodes on any error.
    * procfs/main.c (root_make_node): Use the new interface.
  14. Jérémie Koenig

    procfs: Detect asprintf's ENOMEM in procfs.c rather than everywhere

    * procfs/procfs.h: Make CONTENTS_LEN an ssize_t rather than a size_t,
      and document the change.
    * procfs/procfs.c (procfs_get_contents): Initialize CONTENTS_LEN to a
      negative value, and fail with ENOMEM if it's still negative after the
      callback returns.  (everywhere): Update to ssize_t.
    * procfs/dircat.c, procfs/netfs.c, procfs/process.c,
      procfs/procfs_dir.c, procfs/proclist.c, procfs/rootdir.c: Update to
      ssize_t and the new GET_CONTENTS semantics.
  15. Jérémie Koenig

    procfs: Make contents a char* to avoid typecasts all over the place

    * procfs/procfs.h (procfs_cleanup_contents_with_free,
      procfs_cleanup_contents_with_vm_deallocate, procfs_get_contents,
      struct procfs_ops): Change CONTENTS from a void pointer to a char one.
    * procfs/dircat.c, procfs/netfs.c, procfs/process.c, procfs/procfs.c,
      procfs/procfs_dir.c, procfs/proclist.c, procfs/rootdir.c: Update.
  16. Jérémie Koenig

    procfs: Remove the unused procfs_file module

    * procfs/procfs_file.c, procfs/procfs_file.h: Remove.
    * procfs/Makefile: Remove procfs_file.
  17. Jérémie Koenig

    procfs: Fix the handling of processes without an owner

    * procfs/main.c (argp_parser): New option --anonymous-owner.
    * procfs/main.h: Publish it.
    * procfs/process.c (process_lookup_pid): Use it to set the file owner
      uid of non-owned processes.
  18. Jérémie Koenig

    procfs: Use a global ps_context

    * procfs/proclist.c, procfs/proclist.h (proclist_create_node): Use a
      ps_context passed by the caller; errors are no longer possible, rename
      to proclist_make_node and change the signature accordingly.
    * procfs/rootdir.c, procfs/rootdir.h (rootdir_create_node): Likewise.
    * procfs/main.c (main): Create the ps_context here and pass it to
      root_make_node.  (root_make_node): Pass it to proclist_make_node and
  19. Jérémie Koenig

    procfs: Add a TODO-list

    * procfs/TODO: New file.
  20. Jérémie Koenig

    procfs: netfs_server_loop never returns

    * procfs/main.c: Don't call netfs_server_loop repeatedly; it should
      never return.
  21. Jérémie Koenig

    procfs: Handle errors in main

    * procfs/main.c (main): Handle errors from argp_parse and
  22. Jérémie Koenig

    procfs: Add a --compatible option

    * procfs/main.c (argp_parser): Add --compatible, which sets the options
      required for compatibility with the procps tools.
  23. Jérémie Koenig

    procfs: Add a status file to process directories

    * procfs/process.c: Add a status file.
  24. Jérémie Koenig

    procfs: Add statm to process directories

    * procfs/process.c: Add the statm file.
  25. Jérémie Koenig

    procfs: Add a global cmdline file

    * procfs/main.c (argp_parser, main): Add the --kernel-pid option.
    * procfs/main.h: Publish it.
    * procfs/rootdir.c (rootdir_gc_cmdline): New function.
  26. Jérémie Koenig

    procfs: Add meminfo and vmstat

    * procfs/rootdir.c: Add a (non-empty) meminfo and a vmstat file.
  27. Jérémie Koenig

    procfs: Add a fake-self option to control the self symlink

    * procfs/main.c (argp_parse, main): Add the --fake-self option.
    * procfs/main.h: Publish it.
    * procfs/rootdir.c (rootdir_gc_fakeself, rootdir_entries,
      rootdir_create_node): Use it.
  28. Jérémie Koenig

    procfs: Add --stat-mode to override the perms for [pid]/stat

    * procfs/main.c (argp_parser, main): Add the --stat-mode option.
    * procfs/process.c (process_lookup_pid): Use it.
  29. Jérémie Koenig

    procfs: Add --clk-tck to set the clock unit

    * procfs/main.c (argp_parser, main): Add and parse the --clk-tck option.
    * procfs/main.h: Publish opt_clk_tck.
    * procfs/process.c (sc_tc): Use the user-provided clock frequency.
    * procfs/rootdir.c (rootdir_gc_stat): Likewise.
  30. Jérémie Koenig

    procfs: Play nice with the procps old_Hertz_hack

    * procfs/rootdir.c (rootdir_gc_uptime, rootdir_gc_stat): assume a
      completely idle rather than completely busy system, so that the idle
      seconds can be meaningfully divided by the idle jiffies by procps.
  31. Jérémie Koenig

    procfs: Add an empty meminfo root file

    * procfs/rootdir.c: Add "meminfo", empty for now.
  32. Jérémie Koenig

    procfs: Add a fake "self" symlink

    * procfs/rootdir.c: Add a fake "self" symlink which always points to
  33. Jérémie Koenig

    procfs: Add loadavg

    * procfs/rootdir.c: Add the root file "loadavg".
Something went wrong with that request. Please try again.