Merge tag 'v4.0-rc1' into perf/core, to refresh the tree
authorIngo Molnar <mingo@kernel.org>
Thu, 26 Feb 2015 11:24:50 +0000 (12:24 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 26 Feb 2015 11:24:50 +0000 (12:24 +0100)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
include/linux/perf_event.h
kernel/events/core.c
tools/lib/lockdep/Makefile

@@@ -262,15 -262,9 +262,15 @@@ struct pmu 
        int (*event_idx)                (struct perf_event *event); /*optional */
  
        /*
 -       * flush branch stack on context-switches (needed in cpu-wide mode)
 +       * context-switches callback
         */
 -      void (*flush_branch_stack)      (void);
 +      void (*sched_task)              (struct perf_event_context *ctx,
 +                                      bool sched_in);
 +      /*
 +       * PMU specific data size
 +       */
 +      size_t                          task_ctx_size;
 +
  };
  
  /**
@@@ -306,7 -300,6 +306,7 @@@ struct swevent_hlist 
  #define PERF_ATTACH_CONTEXT   0x01
  #define PERF_ATTACH_GROUP     0x02
  #define PERF_ATTACH_TASK      0x04
 +#define PERF_ATTACH_TASK_DATA 0x08
  
  struct perf_cgroup;
  struct ring_buffer;
@@@ -511,7 -504,7 +511,7 @@@ struct perf_event_context 
        u64                             generation;
        int                             pin_count;
        int                             nr_cgroups;      /* cgroup evts */
 -      int                             nr_branch_stack; /* branch_stack evt */
 +      void                            *task_ctx_data; /* pmu specific data */
        struct rcu_head                 rcu_head;
  
        struct delayed_work             orphans_remove;
@@@ -565,8 -558,6 +565,8 @@@ extern void perf_event_delayed_put(stru
  extern void perf_event_print_debug(void);
  extern void perf_pmu_disable(struct pmu *pmu);
  extern void perf_pmu_enable(struct pmu *pmu);
 +extern void perf_sched_cb_dec(struct pmu *pmu);
 +extern void perf_sched_cb_inc(struct pmu *pmu);
  extern int perf_event_task_disable(void);
  extern int perf_event_task_enable(void);
  extern int perf_event_refresh(struct perf_event *event, int refresh);
@@@ -809,11 -800,6 +809,11 @@@ static inline bool has_branch_stack(str
        return event->attr.sample_type & PERF_SAMPLE_BRANCH_STACK;
  }
  
 +static inline bool needs_branch_stack(struct perf_event *event)
 +{
 +      return event->attr.branch_sample_type != 0;
 +}
 +
  extern int perf_output_begin(struct perf_output_handle *handle,
                             struct perf_event *event, unsigned int size);
  extern void perf_output_end(struct perf_output_handle *handle);
@@@ -928,12 -914,22 +928,22 @@@ struct perf_pmu_events_attr 
        const char *event_str;
  };
  
+ ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr,
+                             char *page);
  #define PMU_EVENT_ATTR(_name, _var, _id, _show)                               \
  static struct perf_pmu_events_attr _var = {                           \
        .attr = __ATTR(_name, 0444, _show, NULL),                       \
        .id   =  _id,                                                   \
  };
  
+ #define PMU_EVENT_ATTR_STRING(_name, _var, _str)                          \
+ static struct perf_pmu_events_attr _var = {                               \
+       .attr           = __ATTR(_name, 0444, perf_event_sysfs_show, NULL), \
+       .id             = 0,                                                \
+       .event_str      = _str,                                             \
+ };
  #define PMU_FORMAT_ATTR(_name, _format)                                       \
  static ssize_t                                                                \
  _name##_show(struct device *dev,                                      \
diff --combined kernel/events/core.c
@@@ -153,7 -153,7 +153,7 @@@ enum event_type_t 
   */
  struct static_key_deferred perf_sched_events __read_mostly;
  static DEFINE_PER_CPU(atomic_t, perf_cgroup_events);
 -static DEFINE_PER_CPU(atomic_t, perf_branch_stack_events);
 +static DEFINE_PER_CPU(int, perf_sched_cb_usages);
  
  static atomic_t nr_mmap_events __read_mostly;
  static atomic_t nr_comm_events __read_mostly;
@@@ -905,15 -905,6 +905,15 @@@ static void get_ctx(struct perf_event_c
        WARN_ON(!atomic_inc_not_zero(&ctx->refcount));
  }
  
 +static void free_ctx(struct rcu_head *head)
 +{
 +      struct perf_event_context *ctx;
 +
 +      ctx = container_of(head, struct perf_event_context, rcu_head);
 +      kfree(ctx->task_ctx_data);
 +      kfree(ctx);
 +}
 +
  static void put_ctx(struct perf_event_context *ctx)
  {
        if (atomic_dec_and_test(&ctx->refcount)) {
                        put_ctx(ctx->parent_ctx);
                if (ctx->task)
                        put_task_struct(ctx->task);
 -              kfree_rcu(ctx, rcu_head);
 +              call_rcu(&ctx->rcu_head, free_ctx);
        }
  }
  
@@@ -1248,6 -1239,9 +1248,6 @@@ list_add_event(struct perf_event *event
        if (is_cgroup_event(event))
                ctx->nr_cgroups++;
  
 -      if (has_branch_stack(event))
 -              ctx->nr_branch_stack++;
 -
        list_add_rcu(&event->event_entry, &ctx->event_list);
        ctx->nr_events++;
        if (event->attr.inherit_stat)
@@@ -1414,6 -1408,9 +1414,6 @@@ list_del_event(struct perf_event *event
                        cpuctx->cgrp = NULL;
        }
  
 -      if (has_branch_stack(event))
 -              ctx->nr_branch_stack--;
 -
        ctx->nr_events--;
        if (event->attr.inherit_stat)
                ctx->nr_stat--;
@@@ -1884,10 -1881,6 +1884,10 @@@ event_sched_in(struct perf_event *event
  
        perf_pmu_disable(event->pmu);
  
 +      event->tstamp_running += tstamp - event->tstamp_stopped;
 +
 +      perf_set_shadow_time(event, ctx, tstamp);
 +
        if (event->pmu->add(event, PERF_EF_START)) {
                event->state = PERF_EVENT_STATE_INACTIVE;
                event->oncpu = -1;
                goto out;
        }
  
 -      event->tstamp_running += tstamp - event->tstamp_stopped;
 -
 -      perf_set_shadow_time(event, ctx, tstamp);
 -
        if (!is_software_event(event))
                cpuctx->active_oncpu++;
        if (!ctx->nr_active++)
@@@ -2562,9 -2559,6 +2562,9 @@@ static void perf_event_context_sched_ou
                        next->perf_event_ctxp[ctxn] = ctx;
                        ctx->task = next;
                        next_ctx->task = task;
 +
 +                      swap(ctx->task_ctx_data, next_ctx->task_ctx_data);
 +
                        do_switch = 0;
  
                        perf_event_sync_stat(ctx, next_ctx);
@@@ -2583,56 -2577,6 +2583,56 @@@ unlock
        }
  }
  
 +void perf_sched_cb_dec(struct pmu *pmu)
 +{
 +      this_cpu_dec(perf_sched_cb_usages);
 +}
 +
 +void perf_sched_cb_inc(struct pmu *pmu)
 +{
 +      this_cpu_inc(perf_sched_cb_usages);
 +}
 +
 +/*
 + * This function provides the context switch callback to the lower code
 + * layer. It is invoked ONLY when the context switch callback is enabled.
 + */
 +static void perf_pmu_sched_task(struct task_struct *prev,
 +                              struct task_struct *next,
 +                              bool sched_in)
 +{
 +      struct perf_cpu_context *cpuctx;
 +      struct pmu *pmu;
 +      unsigned long flags;
 +
 +      if (prev == next)
 +              return;
 +
 +      local_irq_save(flags);
 +
 +      rcu_read_lock();
 +
 +      list_for_each_entry_rcu(pmu, &pmus, entry) {
 +              if (pmu->sched_task) {
 +                      cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
 +
 +                      perf_ctx_lock(cpuctx, cpuctx->task_ctx);
 +
 +                      perf_pmu_disable(pmu);
 +
 +                      pmu->sched_task(cpuctx->task_ctx, sched_in);
 +
 +                      perf_pmu_enable(pmu);
 +
 +                      perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
 +              }
 +      }
 +
 +      rcu_read_unlock();
 +
 +      local_irq_restore(flags);
 +}
 +
  #define for_each_task_context_nr(ctxn)                                        \
        for ((ctxn) = 0; (ctxn) < perf_nr_task_contexts; (ctxn)++)
  
@@@ -2652,9 -2596,6 +2652,9 @@@ void __perf_event_task_sched_out(struc
  {
        int ctxn;
  
 +      if (__this_cpu_read(perf_sched_cb_usages))
 +              perf_pmu_sched_task(task, next, false);
 +
        for_each_task_context_nr(ctxn)
                perf_event_context_sched_out(task, ctxn, next);
  
@@@ -2813,6 -2754,64 +2813,6 @@@ static void perf_event_context_sched_in
        perf_ctx_unlock(cpuctx, ctx);
  }
  
 -/*
 - * When sampling the branck stack in system-wide, it may be necessary
 - * to flush the stack on context switch. This happens when the branch
 - * stack does not tag its entries with the pid of the current task.
 - * Otherwise it becomes impossible to associate a branch entry with a
 - * task. This ambiguity is more likely to appear when the branch stack
 - * supports priv level filtering and the user sets it to monitor only
 - * at the user level (which could be a useful measurement in system-wide
 - * mode). In that case, the risk is high of having a branch stack with
 - * branch from multiple tasks. Flushing may mean dropping the existing
 - * entries or stashing them somewhere in the PMU specific code layer.
 - *
 - * This function provides the context switch callback to the lower code
 - * layer. It is invoked ONLY when there is at least one system-wide context
 - * with at least one active event using taken branch sampling.
 - */
 -static void perf_branch_stack_sched_in(struct task_struct *prev,
 -                                     struct task_struct *task)
 -{
 -      struct perf_cpu_context *cpuctx;
 -      struct pmu *pmu;
 -      unsigned long flags;
 -
 -      /* no need to flush branch stack if not changing task */
 -      if (prev == task)
 -              return;
 -
 -      local_irq_save(flags);
 -
 -      rcu_read_lock();
 -
 -      list_for_each_entry_rcu(pmu, &pmus, entry) {
 -              cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
 -
 -              /*
 -               * check if the context has at least one
 -               * event using PERF_SAMPLE_BRANCH_STACK
 -               */
 -              if (cpuctx->ctx.nr_branch_stack > 0
 -                  && pmu->flush_branch_stack) {
 -
 -                      perf_ctx_lock(cpuctx, cpuctx->task_ctx);
 -
 -                      perf_pmu_disable(pmu);
 -
 -                      pmu->flush_branch_stack();
 -
 -                      perf_pmu_enable(pmu);
 -
 -                      perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
 -              }
 -      }
 -
 -      rcu_read_unlock();
 -
 -      local_irq_restore(flags);
 -}
 -
  /*
   * Called from scheduler to add the events of the current task
   * with interrupts disabled.
@@@ -2845,8 -2844,9 +2845,8 @@@ void __perf_event_task_sched_in(struct 
        if (atomic_read(this_cpu_ptr(&perf_cgroup_events)))
                perf_cgroup_sched_in(prev, task);
  
 -      /* check for system-wide branch_stack events */
 -      if (atomic_read(this_cpu_ptr(&perf_branch_stack_events)))
 -              perf_branch_stack_sched_in(prev, task);
 +      if (__this_cpu_read(perf_sched_cb_usages))
 +              perf_pmu_sched_task(prev, task, true);
  }
  
  static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count)
@@@ -3321,15 -3321,12 +3321,15 @@@ errout
   * Returns a matching context with refcount and pincount.
   */
  static struct perf_event_context *
 -find_get_context(struct pmu *pmu, struct task_struct *task, int cpu)
 +find_get_context(struct pmu *pmu, struct task_struct *task,
 +              struct perf_event *event)
  {
        struct perf_event_context *ctx, *clone_ctx = NULL;
        struct perf_cpu_context *cpuctx;
 +      void *task_ctx_data = NULL;
        unsigned long flags;
        int ctxn, err;
 +      int cpu = event->cpu;
  
        if (!task) {
                /* Must be root to operate on a CPU event: */
        if (ctxn < 0)
                goto errout;
  
 +      if (event->attach_state & PERF_ATTACH_TASK_DATA) {
 +              task_ctx_data = kzalloc(pmu->task_ctx_size, GFP_KERNEL);
 +              if (!task_ctx_data) {
 +                      err = -ENOMEM;
 +                      goto errout;
 +              }
 +      }
 +
  retry:
        ctx = perf_lock_task_context(task, ctxn, &flags);
        if (ctx) {
                clone_ctx = unclone_ctx(ctx);
                ++ctx->pin_count;
 +
 +              if (task_ctx_data && !ctx->task_ctx_data) {
 +                      ctx->task_ctx_data = task_ctx_data;
 +                      task_ctx_data = NULL;
 +              }
                raw_spin_unlock_irqrestore(&ctx->lock, flags);
  
                if (clone_ctx)
                if (!ctx)
                        goto errout;
  
 +              if (task_ctx_data) {
 +                      ctx->task_ctx_data = task_ctx_data;
 +                      task_ctx_data = NULL;
 +              }
 +
                err = 0;
                mutex_lock(&task->perf_event_mutex);
                /*
                }
        }
  
 +      kfree(task_ctx_data);
        return ctx;
  
  errout:
 +      kfree(task_ctx_data);
        return ERR_PTR(err);
  }
  
@@@ -3446,6 -3423,10 +3446,6 @@@ static void unaccount_event_cpu(struct 
        if (event->parent)
                return;
  
 -      if (has_branch_stack(event)) {
 -              if (!(event->attach_state & PERF_ATTACH_TASK))
 -                      atomic_dec(&per_cpu(perf_branch_stack_events, cpu));
 -      }
        if (is_cgroup_event(event))
                atomic_dec(&per_cpu(perf_cgroup_events, cpu));
  }
@@@ -4446,7 -4427,7 +4446,7 @@@ static int perf_mmap(struct file *file
         * If we have rb pages ensure they're a power-of-two number, so we
         * can do bitmasks instead of modulo.
         */
 -      if (nr_pages != 0 && !is_power_of_2(nr_pages))
 +      if (!is_power_of_2(nr_pages))
                return -EINVAL;
  
        if (vma_size != PAGE_SIZE * (1 + nr_pages))
@@@ -6142,7 -6123,6 +6142,7 @@@ static int perf_swevent_add(struct perf
        }
  
        hlist_add_head_rcu(&event->hlist_entry, head);
 +      perf_event_update_userpage(event);
  
        return 0;
  }
@@@ -6612,7 -6592,6 +6612,7 @@@ static int cpu_clock_event_add(struct p
  {
        if (flags & PERF_EF_START)
                cpu_clock_event_start(event, flags);
 +      perf_event_update_userpage(event);
  
        return 0;
  }
@@@ -6687,7 -6666,6 +6687,7 @@@ static int task_clock_event_add(struct 
  {
        if (flags & PERF_EF_START)
                task_clock_event_start(event, flags);
 +      perf_event_update_userpage(event);
  
        return 0;
  }
@@@ -7101,6 -7079,10 +7101,6 @@@ static void account_event_cpu(struct pe
        if (event->parent)
                return;
  
 -      if (has_branch_stack(event)) {
 -              if (!(event->attach_state & PERF_ATTACH_TASK))
 -                      atomic_inc(&per_cpu(perf_branch_stack_events, cpu));
 -      }
        if (is_cgroup_event(event))
                atomic_inc(&per_cpu(perf_cgroup_events, cpu));
  }
@@@ -7232,9 -7214,6 +7232,9 @@@ perf_event_alloc(struct perf_event_att
        if (attr->inherit && (attr->read_format & PERF_FORMAT_GROUP))
                goto err_ns;
  
 +      if (!has_branch_stack(event))
 +              event->attr.branch_sample_type = 0;
 +
        pmu = perf_init_event(event);
        if (!pmu)
                goto err_ns;
@@@ -7597,7 -7576,7 +7597,7 @@@ SYSCALL_DEFINE5(perf_event_open
        /*
         * Get the target context (task or percpu):
         */
 -      ctx = find_get_context(pmu, task, event->cpu);
 +      ctx = find_get_context(pmu, task, event);
        if (IS_ERR(ctx)) {
                err = PTR_ERR(ctx);
                goto err_alloc;
@@@ -7803,7 -7782,7 +7803,7 @@@ perf_event_create_kernel_counter(struc
  
        account_event(event);
  
 -      ctx = find_get_context(event->pmu, task, cpu);
 +      ctx = find_get_context(event->pmu, task, event);
        if (IS_ERR(ctx)) {
                err = PTR_ERR(ctx);
                goto err_free;
@@@ -8539,6 -8518,18 +8539,18 @@@ void __init perf_event_init(void
                     != 1024);
  }
  
+ ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr,
+                             char *page)
+ {
+       struct perf_pmu_events_attr *pmu_attr =
+               container_of(attr, struct perf_pmu_events_attr, attr);
+       if (pmu_attr->event_str)
+               return sprintf(page, "%s\n", pmu_attr->event_str);
+       return 0;
+ }
  static int __init perf_event_sysfs_init(void)
  {
        struct pmu *pmu;
@@@ -35,10 -35,6 +35,10 @@@ bindir = $(prefix)/$(bindir_relative
  
  export DESTDIR DESTDIR_SQ INSTALL
  
 +MAKEFLAGS += --no-print-directory
 +
 +include ../../scripts/Makefile.include
 +
  # copy a bit from Linux kbuild
  
  ifeq ("$(origin V)", "command line")
@@@ -48,21 -44,56 +48,21 @@@ ifndef VERBOS
    VERBOSE = 0
  endif
  
 -ifeq ("$(origin O)", "command line")
 -  BUILD_OUTPUT := $(O)
 +ifeq ($(srctree),)
 +srctree := $(patsubst %/,%,$(dir $(shell pwd)))
 +srctree := $(patsubst %/,%,$(dir $(srctree)))
 +srctree := $(patsubst %/,%,$(dir $(srctree)))
 +#$(info Determined 'srctree' to be $(srctree))
  endif
  
 -ifeq ($(BUILD_SRC),)
 -ifneq ($(BUILD_OUTPUT),)
 -
 -define build_output
 -      $(if $(VERBOSE:1=),@)$(MAKE) -C $(BUILD_OUTPUT) \
 -      BUILD_SRC=$(CURDIR) -f $(CURDIR)/Makefile $1
 -endef
 -
 -saved-output := $(BUILD_OUTPUT)
 -BUILD_OUTPUT := $(shell cd $(BUILD_OUTPUT) && /bin/pwd)
 -$(if $(BUILD_OUTPUT),, \
 -     $(error output directory "$(saved-output)" does not exist))
 -
 -all: sub-make
 -
 -gui: force
 -      $(call build_output, all_cmd)
 -
 -$(filter-out gui,$(MAKECMDGOALS)): sub-make
 -
 -sub-make: force
 -      $(call build_output, $(MAKECMDGOALS))
 -
 -
 -# Leave processing to above invocation of make
 -skip-makefile := 1
 -
 -endif # BUILD_OUTPUT
 -endif # BUILD_SRC
 -
 -# We process the rest of the Makefile if this is the final invocation of make
 -ifeq ($(skip-makefile),)
 -
 -srctree               := $(realpath $(if $(BUILD_SRC),$(BUILD_SRC),$(CURDIR)))
 -objtree               := $(realpath $(CURDIR))
 -src           := $(srctree)
 -obj           := $(objtree)
 -
 -export prefix libdir bindir src obj
 -
  # Shell quotes
  libdir_SQ = $(subst ','\'',$(libdir))
  bindir_SQ = $(subst ','\'',$(bindir))
  
 -LIB_FILE = liblockdep.a liblockdep.so.$(LIBLOCKDEP_VERSION)
 +LIB_IN := $(OUTPUT)liblockdep-in.o
 +
  BIN_FILE = lockdep
 +LIB_FILE = $(OUTPUT)liblockdep.a $(OUTPUT)liblockdep.so.$(LIBLOCKDEP_VERSION)
  
  CONFIG_INCLUDES =
  CONFIG_LIBS   =
@@@ -73,27 -104,37 +73,27 @@@ N         
  
  export Q VERBOSE
  
- INCLUDES = -I. -I/usr/local/include -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES)
+ INCLUDES = -I. -I./uinclude -I./include -I../../include $(CONFIG_INCLUDES)
  
  # Set compile option CFLAGS if not set elsewhere
  CFLAGS ?= -g -DCONFIG_LOCKDEP -DCONFIG_STACKTRACE -DCONFIG_PROVE_LOCKING -DBITS_PER_LONG=__WORDSIZE -DLIBLOCKDEP_VERSION='"$(LIBLOCKDEP_VERSION)"' -rdynamic -O0 -g
 +CFLAGS += -fPIC
  
  override CFLAGS += $(CONFIG_FLAGS) $(INCLUDES) $(PLUGIN_DIR_SQ)
  
  ifeq ($(VERBOSE),1)
    Q =
 -  print_compile =
 -  print_app_build =
 -  print_fpic_compile =
    print_shared_lib_compile =
    print_install =
  else
    Q = @
 -  print_compile =             echo '  CC                 '$(OBJ);
 -  print_app_build =           echo '  BUILD              '$(OBJ);
 -  print_fpic_compile =                echo '  CC FPIC            '$(OBJ);
 -  print_shared_lib_compile =  echo '  BUILD SHARED LIB   '$(OBJ);
 -  print_static_lib_build =    echo '  BUILD STATIC LIB   '$(OBJ);
 -  print_install =             echo '  INSTALL     '$1'        to      $(DESTDIR_SQ)$2';
 +  print_shared_lib_compile =  echo '  LD       '$(OBJ);
 +  print_static_lib_build =    echo '  LD       '$(OBJ);
 +  print_install =             echo '  INSTALL  '$1'   to      $(DESTDIR_SQ)$2';
  endif
  
 -do_fpic_compile =                                     \
 -      ($(print_fpic_compile)                          \
 -      $(CC) -c $(CFLAGS) $(EXT) -fPIC $< -o $@)
 -
 -do_app_build =                                                \
 -      ($(print_app_build)                             \
 -      $(CC) $^ -rdynamic -o $@ $(CONFIG_LIBS) $(LIBS))
 +export srctree OUTPUT CC LD CFLAGS V
 +build := -f $(srctree)/tools/build/Makefile.build dir=. obj
  
  do_compile_shared_library =                   \
        ($(print_shared_lib_compile)            \
@@@ -103,6 -144,22 +103,6 @@@ do_build_static_lib =                             
        ($(print_static_lib_build)              \
        $(RM) $@;  $(AR) rcs $@ $^)
  
 -
 -define do_compile
 -      $(print_compile)                                                \
 -      $(CC) -c $(CFLAGS) $(EXT) $< -o $(obj)/$@;
 -endef
 -
 -$(obj)/%.o: $(src)/%.c
 -      $(Q)$(call do_compile)
 -
 -%.o: $(src)/%.c
 -      $(Q)$(call do_compile)
 -
 -PEVENT_LIB_OBJS = common.o lockdep.o preload.o rbtree.o
 -
 -ALL_OBJS = $(PEVENT_LIB_OBJS)
 -
  CMD_TARGETS = $(LIB_FILE)
  
  TARGETS = $(CMD_TARGETS)
@@@ -112,15 -169,42 +112,15 @@@ all: all_cm
  
  all_cmd: $(CMD_TARGETS)
  
 -liblockdep.so.$(LIBLOCKDEP_VERSION): $(PEVENT_LIB_OBJS)
 +$(LIB_IN): force
 +      $(Q)$(MAKE) $(build)=liblockdep
 +
 +liblockdep.so.$(LIBLOCKDEP_VERSION): $(LIB_IN)
        $(Q)$(do_compile_shared_library)
  
 -liblockdep.a: $(PEVENT_LIB_OBJS)
 +liblockdep.a: $(LIB_IN)
        $(Q)$(do_build_static_lib)
  
 -$(PEVENT_LIB_OBJS): %.o: $(src)/%.c
 -      $(Q)$(do_fpic_compile)
 -
 -## make deps
 -
 -all_objs := $(sort $(ALL_OBJS))
 -all_deps := $(all_objs:%.o=.%.d)
 -
 -# let .d file also depends on the source and header files
 -define check_deps
 -              @set -e; $(RM) $@; \
 -              $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
 -              sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
 -              $(RM) $@.$$$$
 -endef
 -
 -$(all_deps): .%.d: $(src)/%.c
 -      $(Q)$(call check_deps)
 -
 -$(all_objs) : %.o : .%.d
 -
 -dep_includes := $(wildcard $(all_deps))
 -
 -ifneq ($(dep_includes),)
 - include $(dep_includes)
 -endif
 -
 -### Detect environment changes
 -TRACK_CFLAGS = $(subst ','\'',$(CFLAGS)):$(ARCH):$(CROSS_COMPILE)
 -
  tags: force
        $(RM) tags
        find . -name '*.[ch]' | xargs ctags --extra=+f --c-kinds=+px \
@@@ -149,6 -233,8 +149,6 @@@ clean
        $(RM) *.o *~ $(TARGETS) *.a *liblockdep*.so* $(VERSION_FILES) .*.d
        $(RM) tags TAGS
  
 -endif # skip-makefile
 -
  PHONY += force
  force: