Commit Graph

5 Commits

Author SHA1 Message Date
Subash Abhinov Kasiviswanathan 0dcb3df744 misc: uidstat: change release handler for stat read operation
A kmalloced object in the file opening path is not kfreed in the
closing path.

In the struct file_operations, the open operation is assigned to
single_open while release is assigned to seq_release. single_open
internally allocates memory dynamically for an object  of type
seq_operations which is subsequently not freed in the release call
to seq_release.

Fix this by calling single_release which correctly frees this
memory allocated in the open call.

CRs-Fixed: 719283
Change-Id: I3ea677be301244638e3843834c46988ad999ed88
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2014-09-09 10:47:24 -06:00
Arve Hjønnevåg 6908fe248f misc: uidstat: Remove use of obsolete create_proc_read_entry api
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01 15:52:03 -07:00
JP Abgrall 760017d10a misc: uidstat: avoid create_stat() race and blockage.
* create_stat() race would lead to:
  [   58.132324] proc_dir_entry 'uid_stat/10061' already registered

* blocking kmalloc reported by sbranden
 tcp_read_sock()
  uid_stat_tcp_rcv()
    create_stat()
      kmalloc(GFP_KERNEL)

Signed-off-by: JP Abgrall <jpa@google.com>
2013-07-01 14:16:26 -07:00
Mike Chan 1f65785d2b net: activity_stats: Add statistics for network transmission activity
When enabled, tracks the frequency of network transmissions
(inbound and outbound) and buckets them accordingly.
Buckets are determined by time between network activity.

Each bucket represents the number of network transmisions that were
N sec or longer apart. Where N is defined as 1 << bucket index.

This network pattern tracking is particularly useful for wireless
networks (ie: 3G) where batching network activity closely together
is more power efficient than far apart.

New file: /proc/net/stat/activity

output:

Min Bucket(sec) Count
              1 7
              2 0
              4 1
              8 0
             16 0
             32 2
             64 1
            128 0

Change-Id: I4c4cd8627b872a55f326b1715c51bc3bdd6e8d92
Signed-off-by: Mike Chan <mike@android.com>
2013-07-01 13:40:29 -07:00
Mike Chan 5a5f2f9219 misc: uidstat: Adding uid stat driver to collect network statistics.
Signed-off-by: Mike Chan <mike@android.com>
2013-07-01 13:40:20 -07:00