Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146138
b: refs/heads/master
c: 150f516
h: refs/heads/master
v: v3
  • Loading branch information
Markus Metzger authored and Ingo Molnar committed Apr 7, 2009
1 parent a1e1993 commit 9f17f94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 608780a9048efa3e85fbc4d8649b26805cc588aa
refs/heads/master: 150f5164c1258e05b7dea16f29e592f354c48f34
9 changes: 7 additions & 2 deletions trunk/arch/x86/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ static int ds_request(struct ds_tracer *tracer, struct ds_trace *trace,
{
struct ds_context *context;
int error;
size_t req_size;

error = -EOPNOTSUPP;
if (!ds_cfg.sizeof_rec[qual])
Expand All @@ -665,9 +666,13 @@ static int ds_request(struct ds_tracer *tracer, struct ds_trace *trace,
if (!base)
goto out;

/* We need space for alignment adjustments in ds_init_ds_trace(). */
req_size = ds_cfg.sizeof_rec[qual];
/* We might need space for alignment adjustments. */
if (!IS_ALIGNED((unsigned long)base, DS_ALIGNMENT))
req_size += DS_ALIGNMENT;

error = -EINVAL;
if (size < (DS_ALIGNMENT + ds_cfg.sizeof_rec[qual]))
if (size < req_size)
goto out;

if (th != (size_t)-1) {
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/x86/kernel/ds_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#include <asm/ds.h>


#define BUFFER_SIZE 521 /* Intentionally chose an odd size. */

#define BUFFER_SIZE 521 /* Intentionally chose an odd size. */
#define SMALL_BUFFER_SIZE 24 /* A single bts entry. */

struct ds_selftest_bts_conf {
struct bts_tracer *tracer;
Expand Down Expand Up @@ -381,7 +381,7 @@ int ds_selftest_bts(void)
conf.suspend = ds_suspend_bts_noirq;
conf.resume = ds_resume_bts_noirq;
conf.tracer =
ds_request_bts_task(current, buffer, BUFFER_SIZE,
ds_request_bts_task(current, buffer, SMALL_BUFFER_SIZE,
NULL, (size_t)-1, BTS_KERNEL);
local_irq_save(irq);
ds_selftest_bts_cpu(&conf);
Expand Down

0 comments on commit 9f17f94

Please sign in to comment.