~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to kernel/trace/ring_buffer.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 */
6
6
#include <linux/ring_buffer.h>
7
7
#include <linux/trace_clock.h>
8
 
#include <linux/ftrace_irq.h>
9
8
#include <linux/spinlock.h>
10
9
#include <linux/debugfs.h>
11
10
#include <linux/uaccess.h>
669
668
 * the reader page). But if the next page is a header page,
670
669
 * its flags will be non zero.
671
670
 */
672
 
static int inline
 
671
static inline int
673
672
rb_is_head_page(struct ring_buffer_per_cpu *cpu_buffer,
674
673
                struct buffer_page *page, struct list_head *list)
675
674
{
1429
1428
}
1430
1429
EXPORT_SYMBOL_GPL(ring_buffer_resize);
1431
1430
 
 
1431
void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val)
 
1432
{
 
1433
        mutex_lock(&buffer->mutex);
 
1434
        if (val)
 
1435
                buffer->flags |= RB_FL_OVERWRITE;
 
1436
        else
 
1437
                buffer->flags &= ~RB_FL_OVERWRITE;
 
1438
        mutex_unlock(&buffer->mutex);
 
1439
}
 
1440
EXPORT_SYMBOL_GPL(ring_buffer_change_overwrite);
 
1441
 
1432
1442
static inline void *
1433
1443
__rb_data_page_index(struct buffer_data_page *bpage, unsigned index)
1434
1444
{
1468
1478
        return local_read(&bpage->entries) & RB_WRITE_MASK;
1469
1479
}
1470
1480
 
1471
 
/* Size is determined by what has been commited */
 
1481
/* Size is determined by what has been committed */
1472
1482
static inline unsigned rb_page_size(struct buffer_page *bpage)
1473
1483
{
1474
1484
        return rb_page_commit(bpage);
2162
2172
        if (likely(ts >= cpu_buffer->write_stamp)) {
2163
2173
                delta = diff;
2164
2174
                if (unlikely(test_time_stamp(delta))) {
 
2175
                        int local_clock_stable = 1;
 
2176
#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
 
2177
                        local_clock_stable = sched_clock_stable;
 
2178
#endif
2165
2179
                        WARN_ONCE(delta > (1ULL << 59),
2166
 
                                  KERN_WARNING "Delta way too big! %llu ts=%llu write stamp = %llu\n",
 
2180
                                  KERN_WARNING "Delta way too big! %llu ts=%llu write stamp = %llu\n%s",
2167
2181
                                  (unsigned long long)delta,
2168
2182
                                  (unsigned long long)ts,
2169
 
                                  (unsigned long long)cpu_buffer->write_stamp);
 
2183
                                  (unsigned long long)cpu_buffer->write_stamp,
 
2184
                                  local_clock_stable ? "" :
 
2185
                                  "If you just came from a suspend/resume,\n"
 
2186
                                  "please switch to the trace global clock:\n"
 
2187
                                  "  echo global > /sys/kernel/debug/tracing/trace_clock\n");
2170
2188
                        add_timestamp = 1;
2171
2189
                }
2172
2190
        }
2914
2932
        /*
2915
2933
         * cpu_buffer->pages just needs to point to the buffer, it
2916
2934
         *  has no specific buffer page to point to. Lets move it out
2917
 
         *  of our way so we don't accidently swap it.
 
2935
         *  of our way so we don't accidentally swap it.
2918
2936
         */
2919
2937
        cpu_buffer->pages = reader->list.prev;
2920
2938