linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: perf: util: dso:  Remove some unused functions
@ 2015-01-02 21:03 Rickard Strandqvist
  2015-01-05  7:24 ` Adrian Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Rickard Strandqvist @ 2015-01-02 21:03 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras
  Cc: Rickard Strandqvist, Ingo Molnar, Arnaldo Carvalho de Melo,
	Jiri Olsa, Namhyung Kim, Adrian Hunter, Waiman Long,
	Stephane Eranian, linux-kernel

Removes some functions that are not used anywhere:
dso__data_size() dso__data_status_seen()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 tools/perf/util/dso.c |   34 ----------------------------------
 tools/perf/util/dso.h |    3 ---
 2 files changed, 37 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 0247acf..8f0b6a3 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -359,18 +359,6 @@ out:
 	return dso->data.fd;
 }
 
-bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by)
-{
-	u32 flag = 1 << by;
-
-	if (dso->data.status_seen & flag)
-		return true;
-
-	dso->data.status_seen |= flag;
-
-	return false;
-}
-
 static void
 dso_cache__free(struct rb_root *root)
 {
@@ -546,28 +534,6 @@ static int data_file_size(struct dso *dso)
 	return 0;
 }
 
-/**
- * dso__data_size - Return dso data size
- * @dso: dso object
- * @machine: machine object
- *
- * Return: dso data size
- */
-off_t dso__data_size(struct dso *dso, struct machine *machine)
-{
-	int fd;
-
-	fd = dso__data_fd(dso, machine);
-	if (fd < 0)
-		return fd;
-
-	if (data_file_size(dso))
-		return -1;
-
-	/* For now just estimate dso data size is close to file size */
-	return dso->data.file_size;
-}
-
 static ssize_t data_read_offset(struct dso *dso, u64 offset,
 				u8 *data, ssize_t size)
 {
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index acb651a..bd99f25 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -184,7 +184,6 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
  * The dso__data_* external interface provides following functions:
  *   dso__data_fd
  *   dso__data_close
- *   dso__data_size
  *   dso__data_read_offset
  *   dso__data_read_addr
  *
@@ -222,13 +221,11 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
 int dso__data_fd(struct dso *dso, struct machine *machine);
 void dso__data_close(struct dso *dso);
 
-off_t dso__data_size(struct dso *dso, struct machine *machine);
 ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
 			      u64 offset, u8 *data, ssize_t size);
 ssize_t dso__data_read_addr(struct dso *dso, struct map *map,
 			    struct machine *machine, u64 addr,
 			    u8 *data, ssize_t size);
-bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by);
 
 struct map *dso__new_map(const char *name);
 struct dso *dso__kernel_findnew(struct machine *machine, const char *name,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: perf: util: dso:  Remove some unused functions
  2015-01-02 21:03 [PATCH] tools: perf: util: dso: Remove some unused functions Rickard Strandqvist
@ 2015-01-05  7:24 ` Adrian Hunter
  2015-01-06 18:05   ` Rickard Strandqvist
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2015-01-05  7:24 UTC (permalink / raw)
  To: Rickard Strandqvist, Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Jiri Olsa,
	Namhyung Kim, Waiman Long, Stephane Eranian, linux-kernel

On 02/01/15 23:03, Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> dso__data_size() dso__data_status_seen()
> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---

Please do not remove these. They are also preparation for Intel PT.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: perf: util: dso: Remove some unused functions
  2015-01-05  7:24 ` Adrian Hunter
@ 2015-01-06 18:05   ` Rickard Strandqvist
  2015-01-07  9:57     ` Adrian Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Rickard Strandqvist @ 2015-01-06 18:05 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Jiri Olsa, Namhyung Kim, Waiman Long,
	Stephane Eranian, Linux Kernel Mailing List

2015-01-05 8:24 GMT+01:00 Adrian Hunter <adrian.hunter@intel.com>:
> On 02/01/15 23:03, Rickard Strandqvist wrote:
>> Removes some functions that are not used anywhere:
>> dso__data_size() dso__data_status_seen()
>>
>> This was partially found by using a static code analysis program called cppcheck.
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>> ---
>
> Please do not remove these. They are also preparation for Intel PT.
>


Hi

Ok, sorry!

But this  obvious, or would it not be good to add same comments?


Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: perf: util: dso: Remove some unused functions
  2015-01-06 18:05   ` Rickard Strandqvist
@ 2015-01-07  9:57     ` Adrian Hunter
  0 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2015-01-07  9:57 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Jiri Olsa, Namhyung Kim, Waiman Long,
	Stephane Eranian, Linux Kernel Mailing List

On 06/01/15 20:05, Rickard Strandqvist wrote:
> 2015-01-05 8:24 GMT+01:00 Adrian Hunter <adrian.hunter@intel.com>:
>> On 02/01/15 23:03, Rickard Strandqvist wrote:
>>> Removes some functions that are not used anywhere:
>>> dso__data_size() dso__data_status_seen()
>>>
>>> This was partially found by using a static code analysis program called cppcheck.
>>>
>>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
>>> ---
>>
>> Please do not remove these. They are also preparation for Intel PT.
>>
> 
> 
> Hi
> 
> Ok, sorry!
> 
> But this  obvious, or would it not be good to add same comments?

The Intel PT preparation is a little unusual, and of course I am always
optimistic about getting the rest of the patches added. Adding a comment
only to remove it later seems a bit messy.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-07  9:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-02 21:03 [PATCH] tools: perf: util: dso: Remove some unused functions Rickard Strandqvist
2015-01-05  7:24 ` Adrian Hunter
2015-01-06 18:05   ` Rickard Strandqvist
2015-01-07  9:57     ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).